本文整理汇总了PHP中XLite\Core\Converter::getControllerClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::getControllerClass方法的具体用法?PHP Converter::getControllerClass怎么用?PHP Converter::getControllerClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite\Core\Converter
的用法示例。
在下文中一共展示了Converter::getControllerClass方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPortalByTarget
/**
* Get portal object by target
*
* @param string $target Target to search
*
* @return \XLite\Module\CDev\DrupalConnector\Model\Portal
*/
public function getPortalByTarget($target)
{
$class = \XLite\Core\Converter::getControllerClass($target);
$portals = array_filter(\XLite\Module\CDev\DrupalConnector\Drupal\Module::getInstance()->getPortals(), function (\XLite\Module\CDev\DrupalConnector\Model\Portal $portal) use($class) {
return $portal->getController() === $class;
});
return is_array($portals) ? array_shift($portals) : null;
}
示例2: getControllerClass
/**
* Assemble and get controller class name
*
* @return string
*/
protected static function getControllerClass()
{
return \XLite\Core\Converter::getControllerClass(static::getTarget());
}
示例3: getPageInstance
/**
* Return controller for current page
*
* @param string $target Controller target
* @param array $params Controller params OPTIONAL
*
* @return \XLite\Core\WidgetDataTransport
*/
public function getPageInstance($target, array $params = array())
{
$class = \XLite\Core\Converter::getControllerClass($target);
return new \XLite\Core\WidgetDataTransport($class ? new $class(array('target' => $target) + $params) : null);
}
示例4: buildURL
/**
* Compose URL from target, action and additional params
*
* @param string $target Page identifier OPTIONAL
* @param string $action Action to perform OPTIONAL
* @param array $params Additional params OPTIONAL
* @param boolean $forceCuFlag Force flag - use Clean URL OPTIONAL
*
* @return string
*/
public function buildURL($target = '', $action = '', array $params = array(), $forceCuFlag = null)
{
if ('' !== $target && ('' !== $action || isset($params['action']) && '' !== $params['action'])) {
$class = \XLite\Core\Converter::getControllerClass($target);
$paramAction = isset($params['action']) ? $params['action'] : $action;
if ($class && $class::needFormId() && !in_array($paramAction, $class::defineFreeFormIdActions())) {
$params[\XLite::FORM_ID] = \XLite::getFormId(empty($params['static_form_id']));
}
}
return \XLite\Core\Converter::buildURL($target, $action, $params, null, false, $forceCuFlag);
}
示例5: hasFormId
/**
* Check if the form must have the form ID
*
* @return boolean
*/
protected function hasFormId()
{
$class = \XLite\Core\Converter::getControllerClass($this->getParam(static::PARAM_FORM_TARGET));
return $class ? $class::needFormId() : true;
}