当前位置: 首页>>代码示例>>PHP>>正文


PHP bootstrap类代码示例

本文整理汇总了PHP中bootstrap的典型用法代码示例。如果您正苦于以下问题:PHP bootstrap类的具体用法?PHP bootstrap怎么用?PHP bootstrap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了bootstrap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: assignAction

 function assignAction()
 {
     $user = \bootstrap::getInstance()->getUser();
     if (!$user['id'] || $user['type'] != 'admin') {
         return $this->_redirect('/');
     }
     $staff_id = $this->params('staff');
     $staff = $this->userDataMapper()->find(array('id' => $staff_id));
     $form = $this->servicesForm();
     if ($this->getRequest()->isPost() && $form->isValid($this->params()->fromPost())) {
         $this->userDataMapper()->unassignServices($staff_id);
         $this->userDataMapper()->assignMultiple($form->getValue('services'), $staff_id);
         $this->flashMessenger()->addMessage('Staff\'s Services Updated');
         if (isset($_SESSION['admin_setup'])) {
             return $this->redirect()->toRoute('staff-availability', ['staff' => $user['id']]);
         }
         return $this->redirect()->toRoute('manage-staff');
     }
     $this->viewParams['staff'] = $staff;
     $this->viewParams['form'] = $form;
     if (isset($_SESSION['admin_setup'])) {
         $this->viewParams['admin_setup'] = 1;
     }
     return $this->viewParams;
 }
开发者ID:mustafakarali,项目名称:application,代码行数:25,代码来源:ServicesController.php

示例2: indexAction

 function indexAction()
 {
     $this->init();
     $layoutViewModel = $this->layout();
     $progress = new ViewModel(['step' => 2]);
     $progress->setTemplate('application/progress');
     $layoutViewModel->addChild($progress, 'progress');
     $user = \bootstrap::getInstance()->getUser();
     $staffSelector = $this->staffSelector(true, $this->params('service'));
     if (!is_null($staffSelector->getValue('staff'))) {
         $this->staff_selection = $staffSelector->getValue('staff');
     } else {
         $this->staff_selection = $this->listStaff($this->params()->fromQuery('service'));
     }
     $this->viewParams = $this->viewParams + ['staffSelector' => $staffSelector, 'therapist_id' => $this->params()->fromQuery('staff'), 'service' => $this->params('service')];
     $this->renderCalendar($this->viewParams);
     /** Display controls to toggle between week & calendar views */
     $this->viewParams['mode'] = $this->params('mode');
     $viewModel = new ViewModel($this->viewParams);
     $viewModel->setTemplate('application/calendar-mode-chooser');
     //return $viewModel;
     $viewModel = new ViewModel($this->viewParams);
     if ($this->params('mode') == 'week') {
         /** Display the week view */
         $viewModel->setTemplate('week-choose');
     } else {
         /** Display the calendar */
         $viewModel->setTemplate('application/calendar-choose');
     }
     return $viewModel;
 }
开发者ID:mustafakarali,项目名称:application,代码行数:31,代码来源:CalendarController.php

示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     bootstrap::init_imap();
     bootstrap::purge_mailbox('INBOX');
     // import email messages
     foreach (glob(TESTS_DIR . 'Selenium/data/mail/list_*.eml') as $f) {
         bootstrap::import_message($f, 'INBOX');
         $this->msgcount++;
     }
 }
开发者ID:JotapePinheiro,项目名称:roundcubemail,代码行数:11,代码来源:Getunread.php

示例4: __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;
 }
开发者ID:dnerezov,项目名称:paper-boot-dev-pad,代码行数:52,代码来源:add.php

示例5: getInstance

 public static function getInstance()
 {
     if (null === self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
开发者ID:mustafakarali,项目名称:application,代码行数:7,代码来源:bootstrap.php

示例6: start

 public static function start()
 {
     # load config
     $config = (include __DIR__ . '/settings.php');
     self::$config = $config;
     self::loadClasses();
     # bind array $config ke class Connection
     Connection::setConfig(self::$config['db']);
     # make a route
     $router = new Route(self::$config);
     # match the current request
     $match = $router->getRoute()->match();
     if ($match && is_callable($match['target'])) {
         call_user_func_array($match['target'], $match['params']);
     } else {
         # no route was matched
         header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
         echo "<h3>No Route was matched with</h3>";
         echo "<table>";
         echo "<tr>";
         echo "<th>Method</th>";
         echo "<th>Route</th>";
         echo "</tr>";
         // echo "<td>Controller</td>";
         foreach ($router->getRoute()->getRoutes() as $route) {
             print "<tr>";
             print "<td> {$route['0']} </td>";
             print "<td> {$route['1']} </td>";
             print "<tr>";
         }
         echo "</table>";
     }
 }
开发者ID:OckiFals,项目名称:iniforum,代码行数:33,代码来源:bootstrap.php

示例7: utilisateursController

 function utilisateursController(&$command, $config, $app)
 {
     parent::__construct($command, $config, $app);
     $this->catchAll = true;
     // Controle d'acces � la rubrique
     $this->users->checkAccess('configuration');
     // Activation du menu
     $this->menu_admin = 'configuration';
 }
开发者ID:bilel99,项目名称:oge,代码行数:9,代码来源:utilisateurs.php

示例8: statsController

 function statsController(&$command, $config, $app)
 {
     parent::__construct($command, $config, $app);
     $this->catchAll = true;
     // Controle d'acces ŕ la rubrique
     $this->users->checkAccess('stats');
     // Activation du menu
     $this->menu_admin = 'stats';
 }
开发者ID:bilel99,项目名称:oge,代码行数:9,代码来源:stats.php

示例9: thickboxController

 function thickboxController(&$command, $config, $app)
 {
     parent::__construct($command, $config, $app);
     $this->catchAll = true;
     // On masque les Head, header et footer originaux plus le debug
     $this->autoFireHeader = false;
     $this->autoFireHead = false;
     $this->autoFireFooter = false;
     $this->autoFireDebug = false;
 }
开发者ID:bilel99,项目名称:oge,代码行数:10,代码来源:thickbox.php

示例10: __construct

 /**
  * 构造函数
  */
 public function __construct($re)
 {
     if (!is_file(Wind::getRealPath('DATA:install.lock', true))) {
         Wind::getComponent('response')->sendRedirect("install.php");
     }
     parent::__construct($re);
     //云应用监听sql执行
     WindFactory::_getInstance()->loadClassDefinitions(array('sqlStatement' => array('proxy' => 'WIND:filter.proxy.WindEnhancedClassProxy', 'listeners' => array('LIB:compile.acloud.PwAcloudDbListener'))));
     $this->charset = Wind::getComponent('response')->getCharset();
 }
开发者ID:ccq18,项目名称:EduSoho,代码行数:13,代码来源:phpwindBoot.php

示例11: protectedController

 function protectedController(&$command, $config, $app)
 {
     parent::__construct($command, $config, $app);
     $this->autoFireHeader = false;
     $this->autoFireHead = false;
     $this->autoFireView = false;
     $this->autoFireFooter = false;
     $this->autoFireDebug = false;
     $this->catchAll = true;
 }
开发者ID:bilel99,项目名称:oge,代码行数:10,代码来源:protected.php

示例12: ajaxController

 function ajaxController(&$command, $config, $app)
 {
     parent::__construct($command, $config, $app);
     // On place le redirect sur la home
     $_SESSION['request_url'] = $this->lurl;
     $this->autoFireHeader = false;
     $this->autoFireDebug = false;
     $this->autoFireHead = false;
     $this->autoFireFooter = false;
 }
开发者ID:bilel99,项目名称:oge,代码行数:10,代码来源:ajax.php

示例13: settingsController

 function settingsController(&$command, $config, $app)
 {
     parent::__construct($command, $config, $app);
     $this->catchAll = true;
     if (isset($_SESSION['user']['role'])) {
         if ($_SESSION['user']['role'] == 'tresorier' || $_SESSION['user']['role'] == '') {
             header("Location: " . $this->url . '/home');
         }
     }
 }
开发者ID:bilel99,项目名称:oge,代码行数:10,代码来源:settings.php

示例14: menusController

 function menusController(&$command, $config, $app)
 {
     parent::__construct($command, $config, $app);
     $this->catchAll = true;
     // Controle d'acces à la rubrique
     $this->users->checkAccess('edition');
     // Activation du menu
     $this->menu_admin = 'edition';
     // Definition des types d'éléments
     $this->typesElements = array('L' => 'Lien Interne', 'LX' => 'Lien Externe');
 }
开发者ID:bilel99,项目名称:oge,代码行数:11,代码来源:menus.php

示例15: thickboxController

 function thickboxController(&$command, $config, $app)
 {
     parent::__construct($command, $config, $app);
     $this->catchAll = true;
     // On masque les Head, header et footer originaux plus le debug
     $this->autoFireHeader = false;
     $this->autoFireHead = false;
     $this->autoFireFooter = false;
     $this->autoFireDebug = false;
     // On place le redirect sur la home
     $_SESSION['request_url'] = $this->url;
 }
开发者ID:bilel99,项目名称:oge,代码行数:12,代码来源:thickbox.php


注:本文中的bootstrap类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。