本文整理汇总了PHP中WebPage::getIdentifier方法的典型用法代码示例。如果您正苦于以下问题:PHP WebPage::getIdentifier方法的具体用法?PHP WebPage::getIdentifier怎么用?PHP WebPage::getIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebPage
的用法示例。
在下文中一共展示了WebPage::getIdentifier方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Identifier $page)
{
if (!$page->of(WebPage::getIdentifier())) {
throw new \InvalidArgumentException(sprintf('RestartRequestOnPageException expects a web page identifier, %s given.', $page->getFullyQualifiedName()));
}
$this->page = $page;
parent::__construct('RestartRequestOnPageException');
}
示例2: __construct
public function __construct(Identifier $pageIdentifier, Identifier $loginPage)
{
Args::identifierOf($pageIdentifier, WebPage::getIdentifier(), 'pageIdentifier');
Args::identifierOf($loginPage, WebPage::getIdentifier(), 'loginPage');
$this->pageAuthIdentifier = $pageIdentifier;
$this->loginPageIdentifier = $loginPage;
PiconApplication::get()->getSecuritySettings()->setComponentNotAuthorisedListener(new DirectToPageComponentNotAuthorisedListener($loginPage));
}
示例3: mount
public function mount($path, Identifier $page)
{
if (!$page->of(WebPage::getIdentifier())) {
throw new \InvalidArgumentException('Expected an identifier of a web page');
}
if ($this->isMounted($path)) {
throw new \InvalidArgumentException(sprintf('The path %s is already mounted', $path));
}
$this->addToPath($path, $page->getFullyQualifiedName());
$this->mountedPages[] = $path;
}
示例4: setPage
/**
* Set the current page
* @param mixed $page An instance of web page or an Identifier for a web page
* @todo add page params
*/
public function setPage($page)
{
Args::notNull($page, 'page');
if ($page instanceof Identifier) {
if ($page->of(WebPage::getIdentifier())) {
$target = new PageRequestTarget($page);
} else {
throw new \InvalidArgumentException("Expected identifier to be for a web page");
}
} else {
if ($page instanceof WebPage) {
PageMap::get()->addOrUpdate($page);
$target = new PageInstanceRequestTarget($page);
} else {
throw new \InvalidArgumentException(sprintf("setPage expects an identifier for a web page or an instance of a web page and not a %s", get_class($page)));
}
}
if ($this->getRequestCycle()->containsTarget(ListenerRequestTarget::getIdentifier())) {
$url = $this->getRequestCycle()->generateUrl($target);
$this->getRequestCycle()->addTarget(new RedirectRequestTarget($url));
} else {
$this->getRequestCycle()->addTarget($target);
}
}
示例5: __construct
/**
*
* @param Identifier $targetPage The page to redirect to
*/
public function __construct(Identifier $targetPage)
{
Args::identifierOf($targetPage, WebPage::getIdentifier(), 'targetPage');
$this->targetPage = $targetPage;
}