次のルートを接続したい:
登録/about_you
my_profile/edit/about_you
...同じアクションに。しかし、2 番目のルートで、登録ではなく編集ページにいることを識別するために使用できるパラメーターを取り込みたいと考えています。
私は現在、routes.phpに持っています:
Router::connect('/register/:action/*',
array(
'controller' => 'registration'
)
);
Router::connect('/my_profile/edit/:action/*',
array(
'controller' => 'registration',
'edit' => 1
)
);
これは、上記の URL を正しい場所に接続するために機能$this->params['edit']
し、コントローラーで使用できます。ただし、リンクを作成しようとすると、
Router::url(array('controller' => 'registration', 'action' => 'about_you', 'edit' => 1, $i));
私は得る
/register/about_you/0/edit:1
それ以外の
/my_profile/edit/about_you
私は何を間違っていますか?