チェ・ゲバムラの日記

脱犬の道を目指す男のブログ

【CakePHP2.x】Header内で、現在のコントローラーやアクションを指定する方法

引用ですが

コントローラー名 $this->name
アクション名 $this->action
Webroot $this->webroot
現在のURL $this->here



Layout/common.ctp

if($this->action == 'hoge') {
    echo $html->css('hoge');
}

参考
CakePHPでコントローラーやアクションごとにCSS&jsを切り替える方法 | webOpixel