本文整理匯總了PHP中CMS::updateCmsToBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP CMS::updateCmsToBlock方法的具體用法?PHP CMS::updateCmsToBlock怎麽用?PHP CMS::updateCmsToBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CMS
的用法示例。
在下文中一共展示了CMS::updateCmsToBlock方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _postProcess
private function _postProcess()
{
if (isset($_POST['categoryBox']) and is_array($_POST['categoryBox']) and count($_POST['categoryBox'] >= 1)) {
foreach ($_POST['categoryBox'] as $row) {
$cms[] = intval($row);
}
if (CMS::updateCmsToBlock($cms, $this->id)) {
$this->_html .= '<div class="conf confirm">' . $this->l('Cms Updated') . '</div>';
}
} else {
CMS::updateCmsToBlock(array(), $this->id);
}
}
示例2: _postProcess
private function _postProcess()
{
if (Tools::isSubmit('btnSubmit')) {
$categoryBox = Tools::getValue('categoryBox');
if ($categoryBox and is_array($categoryBox) and count($categoryBox)) {
foreach ($categoryBox as $row) {
$cms[] = intval($row);
}
if (CMS::updateCmsToBlock($cms, intval($this->id))) {
$this->_html .= '<div class="conf confirm">' . $this->l('Cms Updated') . '</div>';
}
} else {
Db::getInstance()->Execute('
DELETE FROM `' . _DB_PREFIX_ . 'block_cms`
WHERE `id_block` =' . intval($this->id));
}
}
}