I'm trying to achieve one thing.
I want to have one controller for my CMS that will receive incoming
requests and then through requestAction and some internal mappings to
dispatch the request to the proper controller/action pair together
with params, to return and present result through the dispatcher
view ...
Short example:
routes.php
Router::connect('/my_cms/:controller/:action/*', array('cms' => 1));
Router::connect('/*', array('controller' => 'my_pages', 'action' =>
'dispatch'));
class MyPagesController extends AppController {
// the simpliest version of the dispatcher
function dispatch() {
$this->set('cms_content', $this->requestAction('/
genera_cms/' . $this->params['url']['url'], array('return')));
}
}
and in view I just echo cms_content
Now, It happened that $paginator and other helpers didn't behave as
they should, the helpers were not generating links and other elements
properly.
I browsed the core source and found this
file router.php
function url($url = null, $full = false) {
$_this =& Router::getInstance();
$defaults = $params = array('plugin' => null, 'controller' =>
null,
'action' => 'index');
if(!empty($_this->__params)) {
--->>> if(!isset($_this->params['requested'])) {
$params = $_this->__params[0];
--->>> } else if(isset($_this->params['requested'])) {
$params = end($_this->__params);
}
}
$path = array('base' => null);
if(!empty($_this->__paths)) {
-->>>>> if(!isset($_this->params['requested'])) {
$path = $_this->__paths[0];
-->>>>> } else if(isset($_this->params['requested'])) {
$path = end($_this->__paths);
}
}
................ function continues but is not important
I marked lines with $_this->params['requested'] because when I changed
them to $this->params['requested'] everything worked properly, helpers
now work as I expect them to. I am cakePHP begginer and need to
produce a product on the basis of it, so I want to ask, is this a bug
in the core or I made some changes that will make me some problems on
the other side ??????
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---