We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

syntax for setting the extension end-script variable to TRUE

Development and Programming

Jaaahn's avatar
Jaaahn
4 posts
14 years ago
Jaaahn's avatar Jaaahn

HI, i’ve been looking around and have not managed to find an answer to this one, im developing my first extension / module and need to take control of a process using one of the member hooks.

I can pick up on the hook fine and run my code etc but i need to tell the extension to stop running the code after the hook which i believe is done using the extension->end_script variable.

So my question is how do i correctly set this variable (for EE 2.1.x) in my extension, i’ve tried;

$this->ee->extensions->end_script = TRUE; ee()->extensions->end_script = TRUE; $EXT->end_script = TRUE;

and probably a couple of others… do i need to return this variable at the end of my function or have i just got the syntax wrong?

Cheers in advance,

Jon

Word.

       
David Hyland's avatar
David Hyland
210 posts
14 years ago
David Hyland's avatar David Hyland

hi jon, did you figure this out? if so please share! 😊

       
SaucePan Creative's avatar
SaucePan Creative
32 posts
14 years ago
SaucePan Creative's avatar SaucePan Creative

Just wanted to weigh-in on this thread, as I ran into the same issue.

Couple things:

  1. First make sure you properly reference the EE instance:
$this->EE =& get_instance();
  1. After all other methods are executed change the end_script property to TRUE:
$this->EE->extensions->end_script = TRUE

Any method that is executed that has it’s own hooks, will reset the property to FALSE. This is why it is not returning properly. I battled with this for an hour until I literally went line by to see how the whole thing was executed.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.