Add Counter in plugin.yaml
1
- In your plugin.yaml, add counter and counterLabel like this:
side-menu-item:
label: yourLabel
url: your/controller/url
icon: your-icon
...
counter: \AuthorName\PluginName\Models\YourClass::Yourfunction
counterLabel: Your Label
- then in your model PHP file, add your function which is returning a number like this for example :
<?php namespace \AuthorName\PluginName\Models;
class YourClass extends Model{
...
public static function Yourfunction(){
// you can do whatever you need right here, you just need to not forget to return a number.
return self::count();
}
}
- check the result in your backend
There are no comments yet
Be the first one to comment