本文整理汇总了PHP中Component::getIdentifier方法的典型用法代码示例。如果您正苦于以下问题:PHP Component::getIdentifier方法的具体用法?PHP Component::getIdentifier怎么用?PHP Component::getIdentifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Component
的用法示例。
在下文中一共展示了Component::getIdentifier方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isComponentInstantiationAuthorised
public function isComponentInstantiationAuthorised(Component $component)
{
if ($component instanceof WebPage && $component->getIdentifier()->of($this->pageAuthIdentifier)) {
return $this->isAuthorised();
}
return true;
}
示例2: internalInitialize
public function internalInitialize()
{
parent::internalInitialize();
$callback = function (&$component) {
$component->internalInitialize();
return Component::VISITOR_CONTINUE_TRAVERSAL;
};
$this->visitChildren(Component::getIdentifier(), $callback);
}
示例3: onComponentTagBody
protected function onComponentTagBody(ComponentTag $tag)
{
$this->getResponse()->write('<head>');
parent::onComponentTagBody($tag);
$page = $this->getPage();
$headerResponse = new HeaderResponse($this->getResponse());
PiconApplication::get()->getComponentRenderHeadListener()->onHeadRendering($this, $headerResponse);
$page->renderHead($headerResponse);
$self = $this;
$callback = function (Component &$component) use($headerResponse, $self) {
$component->renderHeadContainer($self, $headerResponse);
return Component::VISITOR_CONTINUE_TRAVERSAL;
};
$page->visitChildren(Component::getIdentifier(), $callback);
$this->getResponse()->write('</head>');
}
示例4: getSubmitForm
private function getSubmitForm()
{
$usingComponent = $this->form;
$form = $this->form;
if ($usingComponent == null) {
$usingComponent = $this->getComponent();
}
$callback = function (&$component) use(&$form) {
if ($component instanceof Form) {
$form = $component;
}
if ($component instanceof ModalWindow) {
return Component::VISITOR_STOP_TRAVERSAL;
}
return Component::VISITOR_CONTINUE_TRAVERSAL;
};
$usingComponent->visitParents(Component::getIdentifier(), $callback);
return $form;
}
示例5: isPageStateless
public function isPageStateless()
{
$stateless = $this->isStateless();
if (!$stateless) {
return $stateless;
}
$reflection = new \ReflectionClass(get_called_class());
$constructor = $reflection->getConstructor();
$params = $constructor->getParameters();
//@todo also add page params to this when in place
$stateless = count($params) == 0;
if (!$stateless) {
return $stateless;
}
$callback = function ($component) use(&$stateless) {
if (!$component->isStateless()) {
$stateless = false;
return Component::VISITOR_STOP_TRAVERSAL;
}
return Component::VISITOR_CONTINUE_TRAVERSAL;
};
$this->visitChildren(Component::getIdentifier(), $callback);
return $stateless;
}
示例6: renderComponentHeader
private function renderComponentHeader(Component $component, Response $response, $headerResponse)
{
$header = new HeaderContainer(HeaderResolver::HEADER_ID);
$page = $component->getPage();
$page->addOrReplace($header);
PiconApplication::get()->getComponentRenderHeadListener()->onHeadRendering($component, $headerResponse);
$page->renderHead($headerResponse);
$component->renderHeadContainer($header, $headerResponse);
$callback = function (Component &$component) use($headerResponse, $header) {
$component->renderHeadContainer($header, $headerResponse);
return Component::VISITOR_CONTINUE_TRAVERSAL;
};
if ($component instanceof MarkupContainer) {
$component->visitChildren(Component::getIdentifier(), $callback);
}
}
示例7: getComponentPath
public function getComponentPath()
{
$page = $this->getPage();
if ($page == null) {
throw new \IllegalStateException(sprintf("Unable to generate a path for component %s as it has an incomplete hierarchy.", $this->id));
}
$path = $this->getId();
$callback = function ($component) use(&$path) {
if (!$component instanceof WebPage) {
$path = $component->getId() . Component::PATH_SEPERATOR . $path;
return Component::VISITOR_CONTINUE_TRAVERSAL;
}
return Component::VISITOR_STOP_TRAVERSAL;
};
$this->visitParents(Component::getIdentifier(), $callback);
return str_replace(self::PATH_SEPERATOR . self::PATH_SEPERATOR, '', $path . self::PATH_SEPERATOR);
}