5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【CakePHP】他のアクションを実行

Last updated at Posted at 2015-04-22

コントローラー内で他のアクション(ビューのレンダリング込み)を実行。
ただし、setAction()後に残りのコードも実行される仕様なので注意。

共通のアクションとビューを使用したい場合に使用する。

書式

$this->setAction($action,$arg,...);

$action:実行するアクション
$arg:アクションに対する引数

サンプル

function foo($id){

}

function bar(){
  $this->setAction('foo',10);
}
5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?