Layout

Hi,

I am having a page. And i divided the page in to two panes.(Left and Right)There are certain links in left pane and if any of the links is clicked in left pane,the corresponding content has to be displayed in right pane.

How to do this in Yii framework??

Just create main.php, put it into /protected/views/layouts/ and use. For example main.php can looks like:




... html header here ...

<div id="page">

    <div id="sidebar">

        ... your links here ...

    </div>

    <div id="content">

        <?php echo $content; ?>

    </div>

</div>

... html footer here ...



use in layout property of the controller to set the layout as


$this->layout='column2';

to display the two columns.

Hi,

<div id="page">

&lt;div id=&quot;sidebar&quot;&gt;


    &lt;?php


		&#036;this-&gt;widget('zii.widgets.CMenu',array(


		'items'=&gt;array(


			array('label'=&gt;'Create a New User', 'url'=&gt;array('/login/create')),


			array('label'=&gt;'View Existing Users', 'url'=&gt;array('/login/view')),


			array('label'=&gt;'Provision','url'=&gt;array('/login/provision')),


			),


	));


	?&gt;


&lt;/div&gt;


&lt;div id=&quot;content&quot;&gt;


    &lt;?php echo &#036;content; ?&gt;


&lt;/div&gt;

</div>

When i give this code and if i click the link (ex: Create a New User) its going to "/login/create.php" only. It is not displaying in the same page. What to do to display it in the right pane of the same page.

Do i need to change any other content in any of the file to display it in the right pane of the same page?

Please help me…

You have to set the layout the the create page.

Go to the controller of site(if you are currently using the it as for your user management) then set the layout of it as




$this->layout='column2';// If you are using your side bar in layout named column2