I am trying to create a login form in the header of the page. It seems that passing the form instance as a parameter to $this->render will not work, since the variable will not be visible from the header. The only way I see is to create a public variable in the controller and access from the view via $this->var
As Keith said , the best solution is using widget also you can use render_partil just u need to change
your action in login form and add full controller name like this :
/// change code to be like this
In fact, i am trying to create a widget to render the login form.
Here is the thing. I’ve managed to encapsulate a login form view and its actions into a widget, but I have problems while trying to show validation errors to the user, since the page needs to be rendered again. I need to pass the validated form to the widget in order to show the messages in the widget view, so I was going to do it as a parameter of the widget, but I found the problem reported in this thread (visibility of the form instance in the header)