本文整理汇总了PHP中Aimeos\MW\View\Iface::addHelper方法的典型用法代码示例。如果您正苦于以下问题:PHP Iface::addHelper方法的具体用法?PHP Iface::addHelper怎么用?PHP Iface::addHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aimeos\MW\View\Iface
的用法示例。
在下文中一共展示了Iface::addHelper方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addUrl
/**
* Adds the "url" helper to the view object
*
* @param \Aimeos\MW\View\Iface $view View object
* @param \TYPO3\Flow\Mvc\Routing\UriBuilder $uriBuilder URL builder object
* @param \TYPO3\Flow\Mvc\RequestInterface|null $request Request object
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function addUrl(\Aimeos\MW\View\Iface $view, \TYPO3\Flow\Mvc\Routing\UriBuilder $uriBuilder, \TYPO3\Flow\Mvc\RequestInterface $request = null)
{
$fixed = array();
if ($request !== null) {
$params = $request->getArguments();
if (isset($params['site'])) {
$fixed['site'] = $params['site'];
}
if (isset($params['locale'])) {
$fixed['locale'] = $params['locale'];
}
if (isset($params['currency'])) {
$fixed['currency'] = $params['currency'];
}
}
$helper = new \Aimeos\MW\View\Helper\Url\Flow($view, $uriBuilder, $fixed);
$view->addHelper('url', $helper);
return $view;
}
示例2: addUrl
/**
* Adds the "url" helper to the view object
*
* @param \Aimeos\MW\View\Iface $view View object
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function addUrl(\Aimeos\MW\View\Iface $view)
{
$fixed = array();
if (Route::current()) {
if (($value = Route::input('site')) !== null) {
$fixed['site'] = $value;
}
if (($value = Route::input('locale')) !== null) {
$fixed['locale'] = $value;
}
if (($value = Route::input('currency')) !== null) {
$fixed['currency'] = $value;
}
}
$helper = new \Aimeos\MW\View\Helper\Url\Laravel5($view, app('url'), $fixed);
$view->addHelper('url', $helper);
return $view;
}
示例3: addUrl
/**
* Adds the "url" helper to the view object
*
* @param \Aimeos\MW\View\Iface $view View object
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function addUrl(\Aimeos\MW\View\Iface $view)
{
$fixed = array();
$request = $this->requestStack->getMasterRequest();
if ($request !== null) {
$attr = $request->attributes;
if (($site = $attr->get('site')) !== null) {
$fixed['site'] = $site;
}
if (($lang = $attr->get('locale')) !== null) {
$fixed['locale'] = $lang;
}
if (($currency = $attr->get('currency')) !== null) {
$fixed['currency'] = $currency;
}
}
$helper = new \Aimeos\MW\View\Helper\Url\Symfony2($view, $this->container->get('router'), $fixed);
$view->addHelper('url', $helper);
return $view;
}
示例4: addUrl
/**
* Adds the "url" helper to the view object
*
* @param \Aimeos\MW\View\Iface $view View object
* @param array $attributes Associative list of URI parameters
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function addUrl(\Aimeos\MW\View\Iface $view, array $attributes)
{
$fixed = array();
if (isset($attributes['site'])) {
$fixed['site'] = $attributes['site'];
}
if (isset($attributes['locale'])) {
$fixed['locale'] = $attributes['locale'];
}
if (isset($attributes['currency'])) {
$fixed['currency'] = $attributes['currency'];
}
$helper = new \Aimeos\MW\View\Helper\Url\Slim($view, $this->container->get('router'), $fixed);
$view->addHelper('url', $helper);
return $view;
}