本文整理汇总了PHP中Nette\Application\UI\PresenterComponentReflection::from方法的典型用法代码示例。如果您正苦于以下问题:PHP PresenterComponentReflection::from方法的具体用法?PHP PresenterComponentReflection::from怎么用?PHP PresenterComponentReflection::from使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Application\UI\PresenterComponentReflection
的用法示例。
在下文中一共展示了PresenterComponentReflection::from方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isAllowed
/**
* Check whenever current user is allowed to use given link
*
* @param string $element etc "this", ":Admin:Show:default"
*
* @return bool
*/
public function isAllowed($element)
{
list($presenter, $action) = $this->formatLink($element);
$presenterReflection = UI\PresenterComponentReflection::from($this->presenterFactory->getPresenterClass($presenter));
if (!$this->requirementsChecker->isAllowed($presenterReflection)) {
return FALSE;
}
$actionKey = UI\Presenter::ACTION_KEY . ucfirst($action);
if ($presenterReflection->hasMethod($actionKey) && !$this->requirementsChecker->isAllowed($presenterReflection->getMethod($actionKey))) {
return FALSE;
}
return TRUE;
}
示例2: isAllowed
/**
* Check whenever current user is allowed to use given link
* @param string $link etc "this", ":Admin:Show:default"
* @return bool
*/
public function isAllowed($link)
{
list($presenter, $action) = $this->formatLink($link);
$presenterReflection = PresenterComponentReflection::from($this->presenterFactory->getPresenterClass($presenter));
if (!$this->permissionChecker->isAllowed($presenterReflection)) {
return false;
}
$actionKey = Presenter::ACTION_KEY . ucfirst($action);
if ($presenterReflection->hasMethod($actionKey) && !$this->permissionChecker->isAllowed($presenterReflection->getMethod($actionKey))) {
return false;
}
return true;
}