本文整理汇总了PHP中Component::build方法的典型用法代码示例。如果您正苦于以下问题:PHP Component::build方法的具体用法?PHP Component::build怎么用?PHP Component::build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Component
的用法示例。
在下文中一共展示了Component::build方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
/**
* @copydoc Grid::build
*/
public function build()
{
if ($this->getState() == 'main') {
if ($param = $this->getParam('bind')) {
$this->setProperty('linkedComponent', $param);
}
$result = Component::build();
if (($component = $this->document->componentManager->getBlockByName($param)) && $this->isEditable) {
if ($this->js) {
$result->documentElement->appendChild($result->importNode($this->js, true));
}
$result->documentElement->appendChild($result->createElement('recordset'));
if (($tbs = $this->getToolbar()) && !empty($tbs)) {
foreach ($tbs as $tb) {
if ($toolbar = $tb->build()) {
$result->documentElement->appendChild($result->importNode($toolbar, true));
}
}
}
}
} else {
if ($this->getType() !== self::COMPONENT_TYPE_LIST) {
$this->setProperty('exttype', 'grid');
}
$result = parent::build();
}
return $result;
}
示例2: build
/**
* @copydoc DataSet::build
*/
public function build()
{
$result = '';
switch ($this->getState()) {
case 'ban':
$result = $this->userEditor->build();
break;
case 'banip':
$result = $this->banIPEditor->build();
break;
default:
$result = parent::build();
break;
}
return $result;
}
示例3: build
public function build()
{
$result = parent::build();
try {
if (!$this->getParam('var')) {
throw new \InvalidArgumentException();
}
$code = E()->getSiteManager()->getCurrentSite()->{$this->getParam('var')};
if (!$code) {
throw new \InvalidArgumentException();
}
$result->documentElement->appendChild(new \DOMText($code));
} catch (\InvalidArgumentException $e) {
$result = false;
}
return $result;
}