Ok, I read about this in the book, but I didn't know what this "slug"
thing should mean...

> This way, there's no ambiguity about which controller is involved
The problem is that it's not just 1 or 2 controllers/actions, but the
whole system is supposed to work this way. So I don't want to pass
this parameter into every action, I thought there could be a "cleaner"
way to grab this conference parameter with the router and have it
written into the session and be able to access it there from
everywhere.

So maybe I should put it into AppController::beforeFilter() ? This
logic happens before the Controller's action, right? I just found out
that I can access it via $this->params['conference'] :)

Just FYI (or for someone else with the same problem), I also had to
rewrite some other code:
1) this is in the AppController:

        public function redirect($url, $status = null, $exit = true)
        {
                if(!isset($url['conference']))
                {
                        $url['conference'] = 
strtolower(Configure::read('shortName'));
                }
                return parent::redirect($url, $status, $exit);
        }

1b) also:
        function beforeFilter()
        {
                $this->Auth->loginAction = array('conference' =>
strtolower(Configure::read('shortName')), 'controller' => 'users',
'action' => 'login');
        }

2) AppHelper:
        public function url($url = null, $full = false)
        {
                if(!isset($url['conference']))
                {
                        $url['conference'] = 
strtolower(Configure::read('shortName'));
                }
                return parent::url($url, $full);
        }

Now the Html->link() and all other stuff I use up to now works as
"normal".

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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