Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Call to a member function AddCssFile() on null
Because I can not add the css style sheet:
class Widgets_Plugin extends Gdn_Plugin{ public function assetModel_styleCss_handler ($sender) { $Sender->AddCssFile('widgets.css', 'plugins/Widgets'); } Fatal Error in Widgets_Plugin.assetModel_styleCss_handler(); Call to a member function AddCssFile() on null The error occurred on or near: /home/vol11_5/byethost15.com/b15_20493697/tradersvzla.ml/htdocs/plugins/Widgets/default.php 25: class Widgets_Plugin extends Gdn_Plugin{ 26: 27: 28: public function assetModel_styleCss_handler ($sender) { 29: $Sender->AddCssFile('widgets.css', 'plugins/Widgets'); 30: } 31: 32: public function base_render_before ($sender) { 33:
Regards,
0
Comments
missing closing } maybe ? check syntax coz that is what it looks like .
I would use this to load css files
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Error Debug:
No works,
Regards,
jajajaja, that idiot apologize the post wrote sender with the first letter in capital letters,
Thks,
That would not cause an issue as far as I know....
$Sender is the same thing as $sender
. It's a mater of style not function. Vanilla code now requires or at least suggests that it should be $sender . But it should not affect the php function as far as the meaning ...❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
It actually does, since variables in PHP are case sensitive (only methods are case insensitive):
This line defined an argument $sender
And this line references a variable $Sender which !== $sender.
As long as you stay consistent you can use either $Sender or $sender as you said, but if you mix them bad things happen (as terabytefrelance figured out).