本文整理匯總了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;
}