Yii Framework Forum: Another Layout Question - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Another Layout Question specific page layout Rate Topic: -----

#1 User is offline   WSBC 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 15-March 13

Posted 15 March 2013 - 04:30 PM

What is the best way to setup the home page using the column2 layout and all of the other pages set to use the column1 layout?
0

#2 User is offline   yiqing95 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 603
  • Joined: 27-December 10
  • Location:china

Posted 15 March 2013 - 07:05 PM

if your site need different layouts , you need design these different layouts ! feel free to use different layouts config in your controller and its action !

you can modify your gii to generate the controller to use "column1" layout (for this topic pls search it ) :lol:
0

#3 User is offline   Balu 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 153
  • Joined: 09-August 11
  • Location:Kerala, India

Posted 16 March 2013 - 09:57 PM

View PostWSBC, on 15 March 2013 - 04:30 PM, said:

What is the best way to setup the home page using the column2 layout and all of the other pages set to use the column1 layout?



Just call you layout in the controller action , which layout you wants, or a new layout

public function actionIndex()
{
$this->layout='//layouts/column2';
$this->render('pages/about');
}

0

#4 User is offline   JFReyes 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 508
  • Joined: 28-October 09
  • Location:Puerto Rico

Posted 17 March 2013 - 02:45 PM

View PostBalu, on 16 March 2013 - 09:57 PM, said:

Just call you layout in the controller action , which layout you wants, or a new layout

public function actionIndex()
{
$this->layout='//layouts/column2';
$this->render('pages/about');
}



And then, leave the other actions intact - they'll inherit the default layout.
José
0

#5 User is offline   WSBC 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 15-March 13

Posted 18 March 2013 - 09:24 AM

Thanks!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users