本文整理匯總了PHP中Concrete\Core\Page\Page::getAttribute方法的典型用法代碼示例。如果您正苦於以下問題:PHP Page::getAttribute方法的具體用法?PHP Page::getAttribute怎麽用?PHP Page::getAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Concrete\Core\Page\Page
的用法示例。
在下文中一共展示了Page::getAttribute方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getPageTypeComposerControlPageNameValue
public function getPageTypeComposerControlPageNameValue(Page $c)
{
$ak = $this->getAttributeKeyObject();
if (is_object($ak)) {
return $c->getAttribute($ak->getAttributeKeyHandle());
}
}
示例2: canPublishPageTypeBeneathTarget
public function canPublishPageTypeBeneathTarget(Type $pagetype, \Concrete\Core\Page\Page $page)
{
if ($page->getAttribute('blog_section') > 0) {
return true;
} else {
return false;
}
}
示例3: getAttribute
/**
* Returns the value of the attribute with the handle $ak
* of the current object.
*
* $displayMode makes it possible to get the correct output
* value. When you need the raw attribute value or object, use
* this:
* <code>
* $c = Page::getCurrentPage();
* $attributeValue = $c->getAttribute('attribute_handle');
* </code>
*
* But if you need the formatted output supported by some
* attribute, use this:
* <code>
* $c = Page::getCurrentPage();
* $attributeValue = $c->getAttribute('attribute_handle', 'display');
* </code>
*
* An attribute type like "date" will then return the date in
* the correct format just like other attributes will show
* you a nicely formatted output and not just a simple value
* or object.
*
*
* @param string|object $akHandle
* @param bool $displayMode
*
* @return type
*/
public function getAttribute($akHandle, $displayMode = false)
{
return parent::getAttribute($akHandle, $displayMode);
}