本文整理汇总了PHP中Concrete\Core\Page\Page::setAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::setAttribute方法的具体用法?PHP Page::setAttribute怎么用?PHP Page::setAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Concrete\Core\Page\Page
的用法示例。
在下文中一共展示了Page::setAttribute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: publish
public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
{
$inspector = \Core::make('import/value_inspector');
$result = $inspector->inspect($value->getValue());
$content = $result->getReplacedContent();
$page->setAttribute($ak->getAttributeKeyHandle(), $content);
}
示例2: publish
public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
{
$links = $value->getValue();
$r = array();
foreach ($links as $link) {
$r[$link['service']] = $link['detail'];
}
$page->setAttribute($ak->getAttributeKeyHandle(), $r);
}
示例3: publish
public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
{
$inspector = \Core::make('import/value_inspector');
$result = $inspector->inspect($value->getValue());
$items = $result->getMatchedItems();
if (isset($items[0]) && $items[0] instanceof FileItem) {
$file = $items[0]->getContentObject();
$page->setAttribute($ak->getAttributeKeyHandle(), $file);
}
}
示例4: publish
/**
* @param CollectionKey $ak
* @param Page $page
* @param AddressAttributeValue $address
*/
public function publish(CollectionKey $ak, Page $page, AttributeValue $address)
{
$value = new Value();
$value->address1 = $address->getAddress1();
$value->address2 = $address->getAddress2();
$value->address3 = $address->getAddress3();
$value->city = $address->getCity();
$value->country = $address->getCountry();
$value->state_province = $address->getStateProvince();
$value->postal_code = $address->getPostalCode();
$page->setAttribute($ak->getAttributeKeyHandle(), $value);
}
示例5: publishToPage
public function publishToPage(Page $c, $data, $controls)
{
// the data for this actually doesn't come from $data. Attributes have their own way of gettin data.
$ak = $this->getAttributeKeyObject();
if (is_object($ak)) {
$controller = $ak->getController();
$value = $controller->createAttributeValueFromRequest();
$c->setAttribute($ak, $value);
}
}
示例6: publish
public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
{
$node = simplexml_load_string($value->getValue());
$page->setAttribute($ak->getAttributeKeyHandle(), $ak->getController()->importValue($node));
}
示例7: setAttribute
public function setAttribute($ak, $value)
{
return parent::setAttribute($ak, $value);
}