本文整理匯總了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;
}