本文整理汇总了PHP中ControllerBase类的典型用法代码示例。如果您正苦于以下问题:PHP ControllerBase类的具体用法?PHP ControllerBase怎么用?PHP ControllerBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ControllerBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* Extend ControllerBase initialize()
*/
public function initialize()
{
parent::initialize();
$this->view->dbs = Db::find();
//list all dbs in the left column
$this->view->currentDbId = $this->request->get('id');
}
示例2: initialize
public function initialize()
{
$this->tag->setTitle('全国统一预约挂号平台');
parent::initialize();
$this->assets->addCss('css/slider.css');
$this->assets->addJs('js/power-slider.js');
}
示例3: __construct
public function __construct()
{
parent::__construct();
$this->AbaAtiva = 29;
$this->AbaAtivaMae = 0;
$this->debug();
}
示例4: initialize
public function initialize()
{
$this->view->setTemplateAfter('main');
$this->view->hdr = 'Мастера';
Tag::setTitle('Makers Panel');
parent::initialize();
}
示例5:
function __construct($app, $db, array $data = NULL)
{
parent::__construct($app, $db, $data);
$this->showErrorPage = FALSE;
$this->actions = ['fetch', 'upload', 'delete', 'descript'];
$this->validateRights([USER_REGISTERED]);
}
示例6: initialize
public function initialize()
{
$this->view->setTemplateAfter('main');
Phalcon\Tag::setTitle('Hypertext Preprocesor');
$this->loadCustomTrans('index');
parent::initialize();
}
示例7: __construct
public function __construct($wpdb)
{
parent::__construct($wpdb);
$db = new \Tabulate\DB\Database($this->wpdb);
$this->table_names = $db->getTableNames();
$this->template = new \Tabulate\Template('grants.html');
}
示例8: initialize
public function initialize()
{
parent::initialize();
//加载js
$this->assets->addJs('backend/js/nestable/jquery.nestable.min.js');
$this->assets->addJs('backend/mt-js/specialty.js');
}
示例9:
function __construct($app, $db, array $data = NULL)
{
parent::__construct($app, $db, $data);
$this->showErrorPage = FALSE;
$this->useTransactions = FALSE;
$this->actions = ['search'];
}
示例10: editAction
public function editAction()
{
$this->tag->setTitle('Каталог | Изменить товар');
parent::initialize();
$products = Real::findFirst($this->dispatcher->getParams("id"));
$auth = $this->session->get('auth');
$profile = $auth['id'];
$get_id = $products->user_id;
if ($profile != $get_id) {
$this->flash->error("Нет прав редактирования!");
$this->view->prof_user = false;
} else {
$this->view->prof_user = true;
$this->view->product = $products;
/*Если есть данные, то сохраняем*/
if ($this->request->isPost()) {
$products->name = $this->request->getPost('name');
$products->price = $this->request->getPost('price');
$products->cover = $this->request->getPost('cover');
$products->description = $this->request->getPost('description');
$products->img2 = $this->request->getPost('img2');
$products->img3 = $this->request->getPost('img3');
$products->img4 = $this->request->getPost('img4');
if ($products->update() == false) {
foreach ($products->getMessages() as $message) {
$this->flash->error((string) $message);
}
} else {
$this->flash->success('Данные успешно сохранены');
}
}
}
}
示例11: initialize
protected function initialize()
{
parent::initialize();
$this->setModel("Permission_group_privilege");
$this->view->breadcrumb_cat = 'Cấu hình phân quyền';
$this->view->action = array("index" => "Xem", "edit" => "Sửa", "add" => "Thêm", "delete" => "Xóa", "status" => "Trạng thái");
}
示例12: searchAction
/**
* Searches for operadora
*/
public function searchAction($yacimientoId = null)
{
parent::importarJsTable();
$numberPage = 1;
if ($yacimientoId != null) {
$operadora = Operadora::find(array('operadora_yacimientoId=:yacimiento_id:', 'bind' => array('yacimiento_id' => $yacimientoId)));
} else {
if ($this->request->isPost()) {
$query = Criteria::fromInput($this->di, "Operadora", $_POST);
$this->persistent->parameters = $query->getParams();
} else {
$numberPage = $this->request->getQuery("page", "int");
}
$parameters = $this->persistent->parameters;
if (!is_array($parameters)) {
$parameters = array();
}
$parameters["order"] = "operadora_id";
$operadora = Operadora::find($parameters);
}
if (count($operadora) == 0) {
$this->flash->notice("No se han encontrado resultados");
return $this->dispatcher->forward(array("controller" => "operadora", "action" => "index"));
}
$paginator = new Paginator(array("data" => $operadora, "limit" => 25, "page" => $numberPage));
$this->view->page = $paginator->getPaginate();
}
示例13: initialize
public function initialize()
{
parent::initialize();
$this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
$this->assets->collection('css')->addCss("css/bootstrap.css")->addCss("css/nivo-lightbox.css")->addCss("css/animate.css")->addCss("css/default.css")->addCss("css/font-awesome.css")->addCss("css/style.css")->addCss("css/responsiveness.css")->setTargetPath('css/ugly.css')->join(true)->setTargetUri('css/ugly.css')->addFilter(new Phalcon\Assets\Filters\Cssmin());
$this->assets->collection('js')->addJs("js/jquery.min.js")->addJs("js/jquery-1.11.0.js")->addJs("js/bootstrap.js")->addJs("js/nivo-lightbox.min.js")->addJs("js/skrollr.js")->addJs("js/parallax.js")->addJs("js/wow.min.js")->addJs("js/SmoothScroll.js")->addJs("js/jquery.easing.min.js")->addJs("js/cbpAnimatedHeader.js")->addJs("js/classie.js")->addJs("js/jqBootstrapValidation.js")->addJs("js/contact.js")->addJs("js/main.js")->setTargetPath('js/ugly.js')->join(true)->setTargetUri('js/ugly.js')->addFilter(new Phalcon\Assets\Filters\Jsmin());
}
示例14: initialize
public function initialize()
{
parent::initialize();
$this->view->setLayout('train');
//加载js
$this->assets->addJs('backend/mt-js/trateacher.js');
}
示例15: searchAction
/**
* Buscando las planillas.
* SI el usuario tiene rol de administrador podra ver todas las planillas.
* Sino se veran las Habilitadas unicamente
*/
public function searchAction()
{
parent::importarJsTable();
$numberPage = 1;
if ($this->request->isPost()) {
$query = Criteria::fromInput($this->di, "Planilla", $_POST);
$this->persistent->parameters = $query->getParams();
} else {
$numberPage = $this->request->getQuery("page", "int");
}
$parameters = $this->persistent->parameters;
if (!is_array($parameters)) {
$parameters = array();
}
$parameters["order"] = "planilla_id DESC";
$planilla = Planilla::find($parameters);
if (count($planilla) == 0) {
$this->flash->notice("No se encontraron resultados");
return $this->dispatcher->forward(array("controller" => "planilla", "action" => "index"));
}
$paginator = new Paginator(array("data" => $planilla, "limit" => 10000, "page" => $numberPage));
$this->view->page = $paginator->getPaginate();
$miSesion = $this->session->get('auth');
if ($miSesion['rol_nombre'] == 'ADMIN') {
$this->view->admin = 1;
} else {
$this->view->admin = 0;
}
}