Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のようにURLのcakephpルートを設定したいと思います:/ param1 / contorllername / actionname /どうすればよいですか、それを行う場合は$this->redirect(array('controller'=>$controllername,'action'=>$actionname))、ページをリダイレクトするためにどのように使用しますか。同様に$this->Html->link、このURLをどのように使用しますか。
$this->redirect(array('controller'=>$controllername,'action'=>$actionname))
$this->Html->link
これはroutes.phpで定義できます
Router::connect( '/:param1/:controller/:action', array(), array('pass' => array('param1')) );
次に、このようにルートを宣言できます
$this->redirect(array('controller'=>'posts','action'=>'view','param1'=>10))
これは/10/投稿/表示にリダイレクトされます