templates - Reuse form in actions "New" and "Edit" -


i have actions "new" , "edit". want reuse same template in both actions. problem is, when i'm creating new entity, want show "new entity" in page title. when i'm editing entity want "editing entity title".

i pass variable in each action indicating action don't feel right doing ... there way detect if it's creation or edition in twig?

how solve common issue?

you can pass entity view , create variable in twig

{% set isnew = not entity.id > 0 %} 

easy?

if want pass form view can entity directly form

{% set entity = form.get('value') %} 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -