Welcome Guest, Not a member yet? Register   Sign In
Hooks Question
#2

[eluser]Glen Swinfield[/eluser]
If what you are asking is can you set a pre-controller hook to run only when a specific controller/method is called, I'm pretty sure the answer is no. But as a quick fix you could just:

Code:
$uri_array = array('user/add' , 'blog/views' , 'pool/vote');
if(in_array($_SERVER['REQUEST_URI'], $uri_array){
   $hook['pre_controller'] = array(
  'class'  => 'MyClass',
  'function'  => 'Myfunction',
  'filename'  => 'Myclass.php',
  'filepath'  => 'hooks',
  'params' => array('beer', 'wine', 'snacks')
   );
}

This would need some tweaking to allow for tailing slashes etc but you get the idea.


Messages In This Thread
Hooks Question - by El Forum - 07-19-2007, 03:09 PM
Hooks Question - by El Forum - 07-20-2007, 02:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB