@jaro
Sorry, I meant AppHelper(), not AppModel. Duh! AppHelper::url() is
called by most helper functions that generate urls, including
HtmlHelper::link(). The code is really straightforward:
function url($url = null, $full = false) {
if (is_array($url)) {
if (isset($url['c'])) {
$url['controller'] = $url['c']; unset($url['c']);
}
if (isset($url['a'])) {
$url['action'] = $url['a']; unset($url['a']);
}
if (isset($url['p'])) {
$url['plugin'] = $url['p']; unset($url['p']);
}
}
return parent::url($url, $full);
}
@Mariano
I'd love a way to globally override Router::url(), but short of
hacking the core I can't see how. The AppHelper::url solution doesn't
work for controller redirects, for example.
@Dardo Sordi
Nice-looking function. I might have to pinch some ideas from it :)
On May 28, 8:05 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> > what about Router::url() ?
>
> My function is just a comodity for me, I usually use it like this:
>
> echo $form->create('Model', array( 'url' => url('ThingsController',
> 'crazyActionName')));
>
> It's just a shorter form of array('controller' => 'ThingsController',
> 'action' => 'crazyActionName')
>
> - Dardo Sordi
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---