cakephp - cake php: correct url to action -


hay together!

i have 2 urls 1 action , each should generate different views.

e.g.: /abc -> connects controller x, action y, view = 0

/def -> connects controller x, action y, view = 1

this works fine with

router::connect('/abc', array('controller' => 'x 'action' => 'y', 'view' => 0));

router::connect('/def', array('controller' => 'x 'action' => 'y', 'view' => 1));


but there problem:

i have formular, wich should send data /def or /abc how can manually set, wich route should used?!

thank help!


edit:

$form->create('model', array('url' => array('action' => 'index', 'view' => '1'))); // def

$form->create('model', array('url' => array('action' => 'index', 'view' => '0'))); // abc

both leads me /controller/index , not /def or /abc

router::connect('/def', array('controller' => 'x' action' => 'y', 'view' => 1), array('pass' => array('view'))); 

then

if($this->params['view']){    // 1 } else{    //its 0 } 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -