CakePHP 2で実行中のColtrollerやaction名を取得したい

Viewで名前が取得できる

A http://sample-url.net/cakephp/news/edit/31
B http://sample-url.net/cakephp/news/delete/31

の場合

コントローラー名の取得

<?php echo $this->name; ?>

アクション名の取得

if ( $this->action=="edit" ) {
  // A の場合
} else {
  // B の場合
}
更新日:
作成日: