public function __construct() { parent::__construct('resources', function (\Twig_Environment $env, $param1, $param2 = '', $version = null) { $req = Slim::getInstance()->request(); $baseUrl = $req->getUrl() . $req->getRootUri(); if (!empty($param2)) { $url = "{$baseUrl}/modules/{$param2}/resources/{$param1}"; } else { $url = "{$baseUrl}/{$param1}"; } if (!$version) { $version = \Novosga\App::VERSION; } return "{$url}?v={$version}"; }, array('needs_environment' => true)); }
/** * {@inheritdoc} */ public function getFunctions() { $lifetimeValue = new \Twig_SimpleFunction('orocrm_channel_account_lifetime', [$this, 'getLifetimeValue']); return [$lifetimeValue->getName() => $lifetimeValue]; }
public function __construct() { parent::__construct($this->getFunctionName(), $this->getFunction(), $this->getOptions()); }
public function __construct($name, $options = array()) { parent::__construct($name, null, array_merge($options, array('needs_environment' => false, 'needs_context' => false, 'node_class' => '\\Assetic\\Extension\\Twig\\AsseticFilterNode'))); }
/** * {@inheritdoc} */ public function getFunctions() { $entitiesMetadataFunction = new \Twig_SimpleFunction('orocrm_channel_entities_metadata', [$this, 'getEntitiesMetadata']); $channelTypeMetadataFunction = new \Twig_SimpleFunction('orocrm_channel_type_metadata', [$this, 'getChannelTypeMetadata']); return [$entitiesMetadataFunction->getName() => $entitiesMetadataFunction, $channelTypeMetadataFunction->getName() => $channelTypeMetadataFunction]; }