I've found another way

$this->setAction('action_name', array('key1' => 'value1', 'key2' =>
'value2'))

and...

function action_name($info = null)
{
  $info1 = $info['key1'];
  $info2 = $info['key2'];
}

Cya guys


On Sep 24, 6:08 pm, LPaulino <[email protected]> wrote:
> I've just found it... func_get_args()
> thx
>
> On Sep 24, 3:33 pm, LPaulino <[email protected]> wrote:
>
>
>
> > Thx man. I found the method (setAction (action, [param, param,
> > param])) here:http://cakephp.org/files/Resources/CakePHP-1.2-Cheatsheet.pdf
>
> > 1 last question: How can I can get those params in the other action?
>
> > Thx
>
> > On Sep 24, 2:51 pm, brian <[email protected]> wrote:
>
> > > Use $this->setAction('action_name'), then.
>
> > >http://api.cakephp.org/class/controller#method-ControllersetAction
>
> > > On Thu, Sep 24, 2009 at 1:20 PM, LPaulino <[email protected]> wrote:
>
> > > > ups.... I said it wrong, I mean from action to action
>
> > > > On 24 set, 13:56, brian <[email protected]> wrote:
> > > >> Those redirects are pointing to the same controller.
>
> > > >> Why not simply point the form at the 2nd controller?
>
> > > >> On Thu, Sep 24, 2009 at 9:16 AM, LPaulino <[email protected]> wrote:
>
> > > >> > Hi guys,
>
> > > >> > I would like to know how can I send data from 1 controller to another
> > > >> > one. Let me explain better why I need that.
>
> > > >> > I have in my view 1 form with a select:
> > > >> > <form method="post" action="/test/index">
> > > >> > <select name="data[Test][selectTest]">
> > > >> >  <option selected value="Test1"> Test1 </option>
> > > >> >  <option value="Test2"> Test2 </option>
> > > >> >  <option value="Test3"> Test3 </option>
> > > >> > </select>
> > > >> > <input type="submit">
> > > >> > </form>
>
> > > >> > When it is send to controller "test", the action index will check
> > > >> > which test was select and will send the data to another controller,
> > > >> > something like a redirect but I dont wanna pass the selectTest value
> > > >> > in the URL. Something like that:
>
> > > >> > function index()
> > > >> > {
> > > >> >   if($this->data['Test']['selectTest'] == 'Test1')
> > > >> >   {
> > > >> >      $this->redirect(array('controller' => 'test', 'action' =>
> > > >> > 'test1', 'data' => $this->data));
> > > >> >   }
> > > >> >   if($this->data['Test']['selectTest'] == 'Test2')
> > > >> >   {
> > > >> >      $this->redirect(array('controller' => 'test', 'action' =>
> > > >> > 'test2', 'data' => $this->data));
> > > >> >   }
> > > >> >   if($this->data['Test']['selectTest'] == 'Test3')
> > > >> >   {
> > > >> >      $this->redirect(array('controller' => 'test', 'action' =>
> > > >> > 'test3', 'data' => $this->data));
> > > >> >   }
> > > >> > }
>
> > > >> > Changing redirect to send, I dont know...
> > > >> > Is that possible? How can I do that?
>
> > > >> > Thx
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to