042_アクションごとにレイアウト動作を変える [CakePHP1.3]
アクションごとにレイアウトやレンダリングを切り換えるには、それぞれのメソッド内で値を設定すればよい。
class HogeController extends AppController {
public $name = "Welcome";
public $uses = null;
public $autoLayout;
public $autoRender;
function index(){
$this->autoLayout = true; // レイアウト ON
$this->autoRender = true; // レンダリング ON
}
function other(){
$this->autoLayout = false; // レイアウト OFF
$this->autoRender = false; // レンダリング OFF
}
}
2012-03-08 22:11
nice!(0)
コメント(0)
トラックバック(0)
コメント 0