本文整理汇总了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();
}