本文整理汇总了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);
}