Re: Is it possible to use components in helper?

2007-07-26 Thread citrus
After having a quick chat with gwoo, I figured it out. Just add one line to my component: $this->controller->params['auth'] = $this; Then the component is available to use in the helper via $this- >params['auth']. Not sure it's the proper way or not, but at least it works. --~--~-~--

Is it possible to use components in helper?

2007-07-26 Thread citrus
Say, I have a component named Auth to check if the current logged in user is able to perform an action or not. Now I want to write a helper function that does the same as $html->link, but only printing the link after making sure that the user is able to perform the action. It'll be something like