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


PHP WebApp::get方法代码示例

本文整理汇总了PHP中WebApp::get方法的典型用法代码示例。如果您正苦于以下问题:PHP WebApp::get方法的具体用法?PHP WebApp::get怎么用?PHP WebApp::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebApp的用法示例。


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

示例1: build

 function build()
 {
     $page = $this->parent;
     $breadcrumb = '    <ul class="breadcrumb">' . PHP_EOL;
     if ($page->parent->config->config['core']['maintenance']) {
         $breadcrumb .= '      <li class="active">Maintenance</li>' . PHP_EOL;
     } elseif (!$page->parent->config->config['core']['database']) {
         $breadcrumb .= '      <li class="active">Site Error</li>' . PHP_EOL;
     } else {
         if ($page->getStatus() != 200) {
             $breadcrumb .= '      <li><a href="/">Home</a></li>' . PHP_EOL;
             $breadcrumb .= '      <li class="active">' . $page->getTitle() . '</li>' . PHP_EOL;
         } elseif (WebApp::get('cat3') !== NULL) {
             $breadcrumb .= '      <li><a href="/">Home</a></li>' . PHP_EOL;
             $breadcrumb .= '      <li><a href="/' . WebApp::get('cat1') . '">' . ucfirst(WebApp::get('cat1')) . '</a></li>' . PHP_EOL;
             $breadcrumb .= '      <li><a href="/' . WebApp::get('cat1') . '/' . WebApp::get('cat2') . '">' . ucfirst(WebApp::get('cat2')) . '</a></li>' . PHP_EOL;
             $breadcrumb .= '      <li class="active">' . $page->getTitle() . '</li>' . PHP_EOL;
         } elseif (WebApp::get('cat2') !== NULL) {
             $breadcrumb .= '      <li><a href="/">Home</a></li>' . PHP_EOL;
             $breadcrumb .= '      <li><a href="/' . WebApp::get('cat1') . '">' . ucfirst(WebApp::get('cat1')) . '</a></li>' . PHP_EOL;
             $breadcrumb .= '      <li class="active">' . $page->getTitle() . '</li>' . PHP_EOL;
         } elseif (WebApp::get('cat1') !== 'core') {
             $breadcrumb .= '      <li><a href="/">Home</a></li>' . PHP_EOL;
             $breadcrumb .= '      <li class="active">' . $page->getTitle() . '</li>' . PHP_EOL;
         } else {
             $breadcrumb .= '      <li class="active">Home</li>' . PHP_EOL;
         }
     }
     $breadcrumb .= '    </ul>' . PHP_EOL;
     $this->breadcrumb = $breadcrumb;
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:31,代码来源:breadcrumb.php

示例2: menu_pages

 public function menu_pages()
 {
     $q = WebApp::get('q');
     $m = WebApp::get('m');
     if ($q === NULL) {
         return new ActionResult($this, Server::get('HTTP_Referer'), 0, 'No search term sent', B_T_FAIL, array('pages' => array()));
     }
     if ($m === NULL || $m === '') {
         return new ActionResult($this, Server::get('HTTP_Referer'), 0, 'No module selected', B_T_FAIL, array('pages' => array()));
     }
     $pages = array();
     $q = '%' . $q . '%';
     $page_query = $this->mySQL_r->prepare("SELECT `ID`,`title` FROM `core_pages` WHERE `title` LIKE ? AND `module_id`=?");
     if (!$page_query) {
         return new ActionResult($this, Server::get('HTTP_Referer'), 0, 'Query failed', B_T_FAIL, array('pages' => array()));
     }
     $page_query->bind_param('si', $q, $m);
     $page_query->execute();
     $page_query->store_result();
     $page_query->bind_result($id, $value);
     while ($page_query->fetch()) {
         $page['id'] = $id;
         $page['text'] = $value;
         if ($id >= pow(10, 6)) {
             $page['text'] = '* ' . $page['text'];
         }
         $pages[] = $page;
     }
     return new ActionResult($this, '/admin/core/menu_add', 0, 'Success', B_T_SUCCESS, array('pages' => $pages));
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:30,代码来源:ajax.php

示例3: setAjax

 public function setAjax()
 {
     //$this->parent->addHeader('content-type', 'application/json');
     // Check to see if we are in maintenance mode
     if (!$this->parent->config->config['core']['database']) {
         $this->setStatus(500);
         return;
     }
     for ($i = 1; $i != 3; $i++) {
         ${'cat' . $i} = WebApp::get('cat' . $i);
     }
     if (!file_exists(__MODULE__ . '/' . $cat2 . '/ajax.php')) {
         $this->parent->debug($this::name_space . ':  Could not find "ajax.php"!');
         $this->result = new ActionResult($this, $_SERVER['REQUEST_URI'], 0, 'Whoops, something went wrong with that action and we\'re trying to fix it. <br />Error: <code>Ajax Ctrl not found</code>');
         return;
     }
     if (!@(include_once __MODULE__ . '/' . $cat2 . '/ajax.php')) {
         $this->parent->debug($this::name_space . ':  Could not access "ajax.php"! Check r/w permissions');
         $this->result = new ActionResult($this, $_SERVER['REQUEST_URI'], 0, 'Whoops, something went wrong with that action and we\'re trying to fix it. <br />Error: <code>Failed to open Ajax</code>');
         return;
     }
     if (class_exists('AjaxController')) {
         $this->ctrl = new AjaxController($this);
         $this->parent->debug($this::name_space . ': AjaxController loaded');
     } else {
         $this->parent->debug($this::name_space . ': Could not find AjaxController class in "ajax.php"!');
         $this->result = new ActionResult($this, $_SERVER['REQUEST_URI'], 0, 'Whoops, something went wrong with that action and we\'re trying to fix it. <br />Error: <code>Ajax Ctrl Ob not found</code>');
     }
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:29,代码来源:ajax.php

示例4: getFooter

 function getFooter($parent)
 {
     if (WebApp::get('cat1') == 'admin' && $this->parent->parent->user->is_loggedIn()) {
         return $this->_processPage(__LIBDIR__ . '/modules/admin/pages/footer.php');
     } else {
         return $this->_processPage(__LIBDIR__ . '/modules/core/pages/footer.php');
     }
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:8,代码来源:controller.php

示例5: _getFilename

 function _getFilename()
 {
     $pagefile = __MODULE__ . '/location/admin/';
     if (WebApp::get('cat3') !== NULL) {
         $pagefile .= WebApp::get('cat3');
     } else {
         $pagefile .= 'dash';
     }
     return $pagefile;
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:10,代码来源:admin.php

示例6: processAction

 function processAction()
 {
     $action = WebApp::get('cat3');
     if (is_callable(array($this, $action))) {
         $this->result = $this->{$action}();
         return true;
     } else {
         $this->result = new ActionResult($this, Server::get('Request_URI'), 0, 'Whoops, something went wrong with that action and we\'re trying to fix it. <br />Error: <code>Action not found: "' . Server::get('Request_URI') . '"</code>');
         return false;
     }
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:11,代码来源:class.baseaction.php

示例7: _getFilename

 function _getFilename()
 {
     $pagefile = __LIBDIR__ . '/modules/' . WebApp::get('cat2') . '/admin/';
     if (WebApp::get('cat3') !== NULL) {
         $pagefile .= WebApp::get('cat3');
         if (WebApp::get('cat4') !== NULL) {
             $pagefile .= '_' . WebApp::get('cat4');
         }
     } else {
         $pagefile .= 'dash';
     }
     return $pagefile;
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:13,代码来源:class.baseadminpagecontroller.php

示例8: processAjax

 function processAjax()
 {
     $ajax = WebApp::get('cat3');
     if (WebApp::get('cat4') !== NULL) {
         $ajax .= '_' . WebApp::get('cat4');
     }
     if (is_callable(array($this, $ajax))) {
         $this->result = $this->{$ajax}();
         return true;
     } else {
         $this->result = new ActionResult($this, $_SERVER['REQUEST_URI'], 0, 'Whoops, something went wrong with that action and we\'re trying to fix it. <br />Error: <code>Ajax not found</code>');
         return false;
     }
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:14,代码来源:class.baseajax.php

示例9: clear_status_msg

 public function clear_status_msg()
 {
     $msg_id = WebApp::get('msg_id');
     if ($msg_id === NULL) {
         $msg_id = WebApp::post('msg_id');
     }
     if ($msg_id === NULL) {
         $this->parent->parent->debug($this::name_space . ': MSG ID was not provided!');
         return new ActionResult($this, '/', 0, 'Failed to clear status message. No ID found.', B_T_FAIL);
     }
     $msg_id = trim(str_replace('alert_', '', $msg_id));
     $msg_id = base64_decode($msg_id);
     Session::del('status_msg', $msg_id);
     $this->parent->parent->debug($this::name_space . ': MSG ID "' . $msg_id . '" was ' . (Session::get('status_msg', $msg_id) === NULL ? '' : 'not ') . 'cleared');
     return new ActionResult($this, '/', 0, 'Cleared status message.', B_T_SUCCESS);
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:16,代码来源:action.php

示例10: __construct

 /**
  * Installer::__construct()
  * 
  * @param mixed $parent
  * @param mixed $details
  * @return
  */
 function __construct($parent, $details = array())
 {
     ignore_user_abort(true);
     $this->parent = $parent;
     $this->mySQL_r = $parent->mySQL_r;
     $this->mySQL_w = $parent->mySQL_w;
     $this->parent->parent->debug('***** ' . $this::name_space . ' - Installer *****');
     $this->parent->parent->debug($this::name_space . ': Version ' . $this::version);
     ignore_user_abort(true);
     if (count($details) == 0) {
         $hash = WebApp::get('id');
         $this->tempModule = Session::get($this::name_space, 'install_from' . $hash);
     } else {
         $this->tempModule = $details['dir'];
         $this->namespace = $details['ns'];
     }
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:24,代码来源:install.php

示例11: run

 public function run()
 {
     $jobID = WebApp::get('j');
     $this->parent->parent->_loadCron();
     $cron = $this->parent->parent->cron;
     $cron->loadJobs();
     $job = $cron->getJob($jobID);
     if ($job === false) {
         return new ActionResult($this, '/admin/core/cron_view', 0, 'Failed to run cron job!<br />Error: <code>Job wasn\'t found</code>', B_T_FAIL);
     }
     $result = $cron->runJob($jobID);
     if ($result->status) {
         return new ActionResult($this, '/admin/core/cron_view', 1, 'Job ran successfully!', B_T_SUCCESS);
     } else {
         return new ActionResult($this, '/admin/core/cron_view', 1, 'Failed to run job!<br /><Error: <code>' . $result->msg . '</code>', B_T_INFO);
     }
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:17,代码来源:cron.action.php

示例12: _getFilename

 function _getFilename($cat1 = '', $cat2 = '', $cat3 = '', $cat4 = '')
 {
     if ($cat1 == '') {
         for ($i = 1; $i <= 4; $i++) {
             ${'cat' . $i} = WebApp::get('cat' . $i);
         }
     }
     $pagefile = __LIBDIR__ . '/modules/' . $cat1 . '/pages/';
     if ($cat2 !== NULL && $cat2 !== '') {
         $pagefile .= $cat2;
         if ($cat3 !== NULL && $cat3 !== '') {
             $pagefile .= '_' . $cat3;
         }
     } else {
         $pagefile .= 'home';
     }
     return $pagefile;
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:18,代码来源:class.basepagecontroller.php

示例13: processPage

 public function processPage()
 {
     if (WebApp::get('cat2') !== NULL) {
         $pagefile = $this->ctrl->_getFilename();
     } else {
         $pagefile = $this->_getFilename();
     }
     if (!file_exists($pagefile . '.php')) {
         $this->parent->parent->debug($this::name_space . ': Failed to load page file "' . str_replace(__LIBDIR__, '', $pagefile) . '.php!');
         return false;
     }
     $this->parent->parent->debug($this::name_space . ': Loading file "' . str_replace(__LIBDIR__, '', $pagefile . '.php') . '"...');
     if (WebApp::get('cat2') !== NULL) {
         $this->parent->setContent($this->ctrl->_processPage($pagefile . '.php'));
     } else {
         $this->parent->setContent($this->_processPage($pagefile . '.php'));
     }
     return true;
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:19,代码来源:controller.php

示例14: secondary_groups

 public function secondary_groups()
 {
     $q = WebApp::get('q');
     if ($q === NULL) {
         return new ActionResult($this, Server::get('HTTP_Referer'), 0, 'No search term sent', B_T_FAIL, array('groups' => array()));
     }
     $groups = array();
     $q = '%' . $q . '%';
     $group_query = $this->mySQL_r->prepare("SELECT `GID`,`name` FROM `core_groups` WHERE `name` LIKE ? AND `type`='s'");
     $group_query->bind_param('s', $q);
     $group_query->execute();
     $group_query->store_result();
     $group_query->bind_result($id, $value);
     while ($group_query->fetch()) {
         $group['id'] = $id;
         $group['text'] = $value;
         $groups[] = $group;
     }
     return new ActionResult($this, '/admin/email', 0, 'Success', B_T_SUCCESS, array('groups' => $groups));
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:20,代码来源:ajax.php

示例15: setFile

 public function setFile()
 {
     include __LIBDIR__ . '/fileMIMEs.php';
     $this->MIMEs = $MIME_type;
     if (WebApp::get('cat1') == 'css' || WebApp::get('cat1') == 'js' || WebApp::get('cat1') == 'images') {
         $filename = strtolower(WebApp::get('cat2')) . '/' . WebApp::get('cat1') . '/' . WebApp::get('cat3');
         $i = 4;
         while (WebApp::get('cat' . $i) !== NULL) {
             $filename .= '/' . WebApp::get('cat' . $i);
             $i++;
         }
         $this->parent->addHeader('file', $filename);
         $file = __MODULE__ . '/' . $filename;
     } elseif (WebApp::get('cat1') == 'fonts') {
         $file = __EXECDIR__ . '/' . Server::get('REQUEST_URI');
     }
     if (file_exists($file)) {
         $this->file = $file;
     } else {
         $this->file = false;
     }
 }
开发者ID:huwcbjones,项目名称:WebFramework,代码行数:22,代码来源:file.php


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