本文整理汇总了PHP中bootstrap::iniControllerParams方法的典型用法代码示例。如果您正苦于以下问题:PHP bootstrap::iniControllerParams方法的具体用法?PHP bootstrap::iniControllerParams怎么用?PHP bootstrap::iniControllerParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bootstrap
的用法示例。
在下文中一共展示了bootstrap::iniControllerParams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($view, $model, $lang, $conf)
{
\bootstrap::iniControllerParams($this, $view);
if (request::isGet() && $model->validateBefore()) {
$pages = new pdo\select('page');
$pages->setColumns(array('page.id', 'page.sequence', 'page.uri', 'page.label', 'page.title', 'page.heading', 'page.description', 'page.content', 'page.icon', 'page.dateCreated', 'page.dateUpdated', 'page.isActive', 'p.id AS parentPageId', 'p.uri AS uriParent', 'p.label AS parentPageTitle'))->addJoin('p', 'id', 'parentId', 'LEFT', true, 'page')->addWhere('page.id', '=', request::get('id'))->execute('fetch');
$view->editData = $pages->data;
}
$page = new pdo\select('page');
$page->setColumns(array('*'))->addWhere('parentId', '=', 0)->addWhere('isActive', '=', 1)->addWhere('uri', '!=', 'about')->orderBy('page.sequence', 'asc')->count()->execute();
$view->navItems = $page->data;
$page = new pdo\select('page');
$page->setColumns(array('
page.id,
page.uri,
page.label,
page.title,
page.description,
page.content'))->addJoin('page_role', 'pageId', 'id', 'RIGHT')->addWhere('uri', '=', 'add')->addWhere('page_role.roleId', '=', session::get('roleId'))->execute('fetch');
$view->page = $page->data;
$page = new pdo\select('page');
$page->setColumns(array('
id,
label'))->orderBy('sequence', 'asc')->execute()->asList('id', 'label');
$view->lookupPageParent = $page->data;
if (request::isPost()) {
if ($model->validateAfter()) {
$data = array('parentId' => request::get('parentId'), 'sequence' => request::get('sequence'), 'uri' => request::get('uri'), 'label' => request::get('label'), 'title' => request::get('title'), 'heading' => request::get('heading'), 'description' => request::get('description'), 'icon' => request::get('icon'), 'content' => request::get('content'), 'dateUpdated' => date('Y-m-d H:i:s'));
$page = new pdo\insert('page');
$page->setColumns(array_keys($data))->setValues(array_values($data))->execute();
$view->data = $data;
} else {
$view->errors = $model->getErrors();
}
}
$navSub = new pdo\select('page');
$navSub->setColumns(array('
page.id,
page.uri,
page.label,
page.title,
page.icon,
page.description,
page.content,
p.id AS parentPageId,
p.uri AS uriParent,
p.label AS parentPageTitle'))->addJoin('p', 'id', 'parentId', 'LEFT', true, 'page')->addJoin('page_role', 'pageId', 'id', 'RIGHT')->addWhere('page_role.isNav', '=', 1)->addWhere('page_role.roleId', '=', session::get('roleId'))->orderBy('page.sequence', 'asc')->execute();
// echo '<pre>';
//print_r($navSub->data);
//die('kj');
$view->navSub = $navSub->data;
}