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.
Using views in plugins
Hello!
I am workin on getting familiar with how to make my own plugins with Vanilla and am wondering about something very basic. And that is how to use views with plugins.
In the default.master.php I added a line like this:
$this->FireEvent('MyTestEvent');
And in my plugin file, I added an event handler like this:
public function Base_MyTestEvent_Handler(&$Sender) {
echo 'My Test Event';
}
It works fine. But I don't want to have to add a whole lot of echo '' in my plugin files. I'd rather use views. After having studied some of the plugins that have been released, I am left a bit more confused as of how to use views. The documentation doesn't help me much either. Does anyone have any tips on how to set up views for plugins?
I am workin on getting familiar with how to make my own plugins with Vanilla and am wondering about something very basic. And that is how to use views with plugins.
In the default.master.php I added a line like this:
$this->FireEvent('MyTestEvent');
And in my plugin file, I added an event handler like this:
public function Base_MyTestEvent_Handler(&$Sender) {
echo 'My Test Event';
}
It works fine. But I don't want to have to add a whole lot of echo '' in my plugin files. I'd rather use views. After having studied some of the plugins that have been released, I am left a bit more confused as of how to use views. The documentation doesn't help me much either. Does anyone have any tips on how to set up views for plugins?
Tagged:
0
Comments
Would you happen to know what's the difference between these two lines?
The FetchView function will just return the view so you can echo it.