php - include a menu in some pages -


i working yii framework , have made following, inde.php:

enter image description here

when click on dosseirs, following image:

enter image description here

the problem on dossiers page, table includes tabs dosseir/managment info/system beheer, should in other pages well, index when click on systembeheer should able see there.

this system beheer: enter image description here can see doesnt contain tabs mentioned. can go system beheer page , can paste code of tabs there, , able see tabs, not corret, should able use code once , see result in pages.

this want want tabs preented in index.php instead of list 3 options. when click on dosseirs should change title of page dosseirs, when click on managment info should change title that, , when click on systembeheer should able see title changing systembeheer , should include tabs usual inside system beheer tabs there should 5 more tabs different name like tabs using.

this how approach :

in private\protected\views\layouts have main.php , in private\protected\views\layouts\includes have footer/header/menu .php

inside main.php have:

<div id="mainmenu">         <?php $this->widget('zii.widgets.cmenu',array(             'items'=>array(                 array('label'=>'login', 'url'=>array('/site/login'), 'visible'=>yii::app()->user->isguest),                 array('label'=>'logout ('.yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!yii::app()->user->isguest)             ),         )); ?>     </div><!-- mainmenu --> 

here code tabs:

<?php      $tab1=$this->renderpartial('_tab1', null, $return=true);     $this->widget('zii.widgets.jui.cjuitabs',array(     'tabs'=>array(         'dossier'=>array('content'=>$tab1, 'id'=>'form'),         'managment info'=>array('content'=>'content tab 2', 'id'=>'tab2'),         'systeem beheer'=> 'content tab 3'         // panel 3 contains content rendered partial view     ),     // additional javascript options tabs plugin     'options'=>array(         'collapsible'=>true,     )));   ?> 

how can have tabs in dosseir/managment info , system beheer each own title?

creata separate page tabs, , render partialy on other pages.

tabs.php

<?php  $tab1=$this->renderpartial('_tab1', null, $return=true); $this->widget('zii.widgets.jui.cjuitabs',array( 'tabs'=>array(     'dossier'=>array('content'=>$tab1, 'id'=>'form'),     'managment info'=>array('content'=>'content tab 2', 'id'=>'tab2'),     'systeem beheer'=> 'content tab 3'     // panel 3 contains content rendered partial view ), // additional javascript options tabs plugin 'options'=>array(     'collapsible'=>true, )));  ?> 


dosseirs.php

///this dosseirs page <?php   $this->renderpartial('tabs'); //this render tabs.php  ?> 

systemdesser.php

//this systemdesse page  <?php   $this->renderpartial('tabs'); //this render tabs.php  ?>      

if want render tabs.php different data each page, can pass parameter below, use parameter in if statement inside tabs.php

$this->renderpartial('tabs', array('myparam'=>$foo)); 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -