On Tue, Oct 6, 2009 at 7:01 PM, lokesh sharma <[email protected]> wrote:
>
> Currently I'm facing problem in Auth->loginRedirect.
> AS per my requirement, I have to pass parameter value also in
> controller's action. But after searching alot, I didnt find any option
> except  '$this->Auth->loginRedirect = array('controller' =>
> 'schooladmins', 'action' => 'view');' which means in this array I can
> pass only controller name and action name.
> How can I solve this problem? Please help me out.
> Any help regarding this will be very help full.
>

You can create a route for it. What type of param do you want to pass? If an id:

Router::connect(
        '/schooladmins/view/:id/',
        array('controller' => 'schooladmins', 'action' => 'view'),
        array('id' => '[0-9]+', 'pass' => array('id'))
);

$this->Auth->loginRedirect = array(
        'controller' => 'schooladmins',
        'action' => 'view',
        'id' => $id
);


If you want the URL to actually appear as
/something/else/ID

(where ID is the numeric $id)

Router::connect(
        '/something/else/:id/',
        array('controller' => 'schooladmins', 'action' => 'view'),
        array('id' => '[0-9]+', 'pass' => array('id'))
);

--~--~---------~--~----~------------~-------~--~----~
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