|
@@ -12,13 +12,20 @@ class RemoteClientExtension extends \Twig_Extension
|
|
|
*/
|
|
|
protected $webservice;
|
|
|
|
|
|
+ /**
|
|
|
+ * @var string
|
|
|
+ */
|
|
|
+ protected $remoteClientCreateUrl;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @param Webservice $webservice
|
|
|
+ * @param string $remoteClientCreateUrl
|
|
|
*/
|
|
|
- public function __construct(Webservice $webservice)
|
|
|
+ public function __construct(Webservice $webservice, $remoteClientCreateUrl)
|
|
|
{
|
|
|
$this->webservice = $webservice;
|
|
|
+ $this->remoteClientCreateUrl = $remoteClientCreateUrl;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -28,11 +35,13 @@ class RemoteClientExtension extends \Twig_Extension
|
|
|
{
|
|
|
return array(
|
|
|
new \Twig_SimpleFunction('remote_client', array($this, 'getClient')),
|
|
|
+ new \Twig_SimpleFunction('remote_client_url', array($this, 'getClientCreateUrl')),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @param int $clientId
|
|
|
+ *
|
|
|
* @return string
|
|
|
*/
|
|
|
public function getClient($clientId)
|
|
@@ -40,6 +49,14 @@ class RemoteClientExtension extends \Twig_Extension
|
|
|
return $this->webservice->getById('client', $clientId);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getClientCreateUrl()
|
|
|
+ {
|
|
|
+ return $this->remoteClientCreateUrl;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @return string
|
|
|
*/
|