Re: How to set a variable inside an extended Cake Class

2012-08-29 Thread Chetan Patel
Write below router in route.php Router::connect('/cms_pages/:action/*', array('controller' => 'cms_pages', 'action' => 'view'), array( 'routeClass' => 'SluggableRoute', 'your_variable_name' => array('your_variable_value') )); Write below code in a file

Re: How to set a variable inside an extended Cake Class

2012-08-29 Thread lowpass
CakeRoute doesn't talk to View. You can set params to be passed to the controller, though. For example (in parse method): $params = parent::parse($url); ... $slugs = array_flip(Set::extract("/Page/slug_${params['lang']}", $data)); if (isset($slugs[$params['slug']])) { $params['pass'][]

How to set a variable inside an extended Cake Class

2012-08-29 Thread Leonhart
Hi guys I'm stuck on a new problem these hours... I've just coded an extended CakeRoute and I need to set some variables. Unfortunately, the $this->set() function can't be used as it points to the extended CakeRoute class. How can I set a variable inside the parse() function for showing it insid