Hi guys,

I'd be interested to hear any of the core developers (nate, nut, gwoo
and co.) to tell me a little more about admin.routing in the latest
1.2 (atm r5669 - though the dispatcher.php was last modified in r5628)

We've ran into a few issues with using admin routing with this
version, to a point where I asked a dev to start a new app from
scratch, with the latest core and configuring admin.routing properly.
The results weren't great to tell you the least. Activating the
Admin.routing by uncommenting the Configure::write('Routing.admin',
'admin'); in the config/core.php just doesn't do it! fiddling around
raised all sorts of errors which I will not list.

Now I had a look at the code and the main problem I found was around
line 173;

// line 160-171
$prefixes = Router::prefixes();
if (!empty($prefixes)) {
        if (isset($this->params['prefix'])) {
                $this->params['action'] = $this->params['prefix'] . '_' . $this-
>params['action'];
        } elseif (strpos($this->params['action'], '_') !== false) {
                list($prefix, $action) = explode('_', $this->params['action']);
                $privateAction = in_array($prefix, $prefixes);
        }
}
$protected = array_map('strtolower',
get_class_methods('appcontroller'));
$classMethods = array_map('strtolower',
get_class_methods($controller));

// line 173-175
if (in_array(low($this->params['action']), $protected)  ||
strpos($this->params['action'], '_', 0) === 0) {
        $privateAction = true;
}


Calling /admin/controller/index .... $this->params['action'] becore
admin_index at line 163 which is quite right, but then the check on
line 173 fails because $protected contains a list of *ALL* methods in
the controller.\

Anyways... we're puzzled around here...

Any body could shed some light on this?

Cheers,

Seb.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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