I have a two views for create and update users on my site (usual situation), and both views share other view, called "_form.php", which holds CActiveForm widget.
Also I want to add functionality to form, using jsTree plugin, and I want it on both views, create and update. So, I put this code in _form.php…
…and render _form in create and update views using renderPartial() with third parameter set to ‘true’.
Unexpectedly, all my js files have been included twice, once in head section of page and once immediately before form. I guess such behavior caused by double output process, one within render(‘create’), and second in renderPartial.
I resolve this by duplicate code above in create and update views, so now it’s ok. But I wonder, is there a better practice?