how to make my plugin works on every page?
Hi:
How to make my plugin works on every page except the backend web pages?
Should I add a method named Base_Render_Before(&$Sender) in my plugin?
Thanks.
0
Hi:
How to make my plugin works on every page except the backend web pages?
Should I add a method named Base_Render_Before(&$Sender) in my plugin?
Thanks.
Comments
but Base_Render_Before looks can not work for me.
Anybody can help for this?
Sure, but not within a couple of hours. First post : 4:56 AM, second post : 5:06 AM, last post : 9:25 AM. Give it some time. Also post your VANILLA VERSION.
There was an error rendering this rich post.
no for any function...
you should always use ($Sender) not (&$Sender)
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I would suggest looking at others' work in the addons section for inspiration.
Or just inspect the
$Sendervariable to see what is in there.//This is a common hook that fires for all controllers on the Render method public function Base_Render_Before($Sender) { // only execute on controllers that aren't using the dashboard view if($Sender->MasterView != 'admin') { // interesting code would go here } }To re-iterate @peregrine's point. Do not explicitly pass a variable by reference. PHP implicitly passes objects by reference. To wit, using
&$Senderis unsupported in the 2.1 branch.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Hi:
I'm useing vanilla 2.0.18.4 version,should I always use ($Sender) not (&$Sender)?
Yes always use ($Sender) . We are changing all plugins to not have & .
You should update to 2.0.18.8 for security reasons.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Hi:
I referenced your code to make my code more strong:
if (($_REQUEST['p'] && strpos($_REQUEST['p'], '/dashboard') === 0) || $Sender->MasterView == 'admin') { //filter the backend pageThanks!