I created the main.php under layout, Then I created a separate index.php for my registration form. I want my landing page/site index page be like facebook, with a registration form and a login form on the top tool bar.
The problem I’m facing is, I don’t know how to integrate the two in the same layout. I already used the $content
for the registration form, I need to know how I can create another variable that can be used for the login form ?
Please let me know if there is any way around it. I appreciate it.
I am not able to comprehend the exact requirement of yours.
Anyway let us consider that we have a layout test in views/layouts.
<!-- for login -->
<?php echo $login;?>
<!-- for registeration-->
<?php echo $register;?>
Now in a controller and in some action we can do the following.
public function actionSomeAction()
$register=$this->renderPartial("register",array(),true,true);//getting the registeration form along with scripts.
$login=$this->renderPartial("login",array(),true,true);//getting loginform form along with scripts.
If you want to embed the test layout in any other layouts like main layout,