Plugin Base URL for Logo

Hi

I’m developing a plugin for V4 which requires me to display a logo located in the plugin assets directory in my list view, update and preview views. How do I get the plugin base URL to include the logo in an img tag in the views? Or is there another way to display an image in views?

Thanks!

Use the plugins_path helper function

$path = plugins_path('author/plugin/assets/images/xx.jpg');

Hi, thank you, but that results in the fully qualified /home/… path, which can’t be used in an img tag.

Found the solution!

<?= asset('plugins/myvendor/myplugin/assets/images/logo.png'); ?>
1 Like