本文整理匯總了PHP中Concrete\Core\Multilingual\Page\Section\Section::assign方法的典型用法代碼示例。如果您正苦於以下問題:PHP Section::assign方法的具體用法?PHP Section::assign怎麽用?PHP Section::assign使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Concrete\Core\Multilingual\Page\Section\Section
的用法示例。
在下文中一共展示了Section::assign方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: add_content_section
public function add_content_section()
{
if (Loader::helper('validation/token')->validate('add_content_section')) {
if (!Loader::helper('validation/numbers')->integer($this->post('pageID')) || $this->post('pageID') < 1) {
$this->error->add(t('You must specify a page for this multilingual content section.'));
} else {
$pc = Page::getByID($this->post('pageID'));
}
if (!$this->error->has()) {
$lc = Section::getByID($this->post('pageID'));
if (is_object($lc)) {
$this->error->add(t('A multilingual section page at this location already exists.'));
}
}
if (!$this->error->has()) {
if ($this->post('msLanguage')) {
$combination = $this->post('msLanguage') . '_' . $this->post('msCountry');
$locale = Section::getByLocale($combination);
if (is_object($locale)) {
$this->error->add(t('This language/region combination already exists.'));
}
}
}
if (!$this->error->has()) {
Section::assign($pc, $this->post('msLanguage'), $this->post('msCountry'));
$this->redirect('/dashboard/system/multilingual/setup', 'multilingual_content_updated');
}
} else {
$this->error->add(Loader::helper('validation/token')->getErrorMessage());
}
$this->view();
}