I have defined a shared service baseImagesURL
in my configuration Class but when I try to use it in volt it throws this error Phalcon\Mvc\View\Exception: Macro 'baseImagesURL' does not exist
/**
* Create url helper service
* Instance of Phalcon\Mvc\Url.
* This service helps in the setting base images folder URL
*/
$di->setShared('baseImagesURL', function() use ($di) {
/** @var Config $config */
$config = $di->get('config');
$url = new Url();
$url->setStaticBaseUri( $config->path("environment.baseImagesUri"));
return $url;
});
Volt
<img src="{{baseImagesURL('Labor-Sale-big.jpg')}}" >