• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP controller类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: create

 private function create() {
     init::importClass(config::$load); //получаем список классов..
     init::importJS(config::$scripts); //скриптов..
     init::importCSS(config::$styles); //стилей
     $control = new controller;
     $control->getData();
 }
开发者ID:salatproduction,项目名称:IT-HOUSE-Standalone,代码行数:7,代码来源:init.class.php


示例2: testCss

 public function testCss()
 {
     $c = new controller();
     $this->assertEquals('', $c->getCss());
     $c->css('.class{text-align: center;}');
     $this->assertEquals('<style type="text/css">.class{text-align: center;}</style>', $c->getCss());
 }
开发者ID:alexqwert,项目名称:kanon,代码行数:7,代码来源:controllerTest.php


示例3: setMsg

function setMsg($app, $msgList)
{
    $msgFile = DIR_APP . "/" . $app . "/msg/" . LANG_PRINCIPAL . ".json";
    $c = new controller();
    $c->saveMsg($app, LANG_PRINCIPAL);
    // setJson enregiste un array qui va etre convertie au format json dans le fichier pointer;
    $c->setJson($msgFile, $msgList);
}
开发者ID:rodbox,项目名称:rodbox3,代码行数:8,代码来源:scan_msg.php


示例4: __construct

 /**
  *
  */
 function __construct()
 {
     $controller = new controller();
     $url = $controller->getUrl();
     switch ($url[0]) {
         case 'index':
             $controller->getIndex();
             break;
     }
 }
开发者ID:hikvladimir,项目名称:shop,代码行数:13,代码来源:bootstrap.php


示例5: router

 public static function router($app, $module, $event, $params, $ajax_conf = array(), $name_utility = '')
 {
     $security = APP_PATH . $app . DS . 'security.php';
     include $security;
     # Es una utilidad?
     if ($name_utility) {
         $pathScript = ROOT_PATH . DS . 'resources' . DS . 'utility' . DS . $name_utility . '.php';
         include $pathScript;
     } else {
         $pathModel = APP_PATH . $app . DS . $module . DS . 'dataModel.php';
         $pathHandler = APP_PATH . $app . DS . $module . DS . 'handlerEvent.php';
         $pathIndex = APP_PATH . $app . DS . $module . DS . 'index.php';
         if (file_exists($pathIndex)) {
             include $pathModel;
             include $pathHandler;
             if (class_exists('controller')) {
                 global $objAjax;
                 switch (AJAX_ENGINE) {
                     case 'xajax':
                         require PLUGINS_PATH . 'xajax/xajax_core/xajax.inc.php';
                         # Agilizar el rendimiento
                         $objxAjax = new xajax();
                         $objxAjax->setFlag("debug", $ajax_conf[AJAX_ENGINE]['debug']);
                         $objxAjax->setFlag('decodeUTF8Input', $ajax_conf[AJAX_ENGINE]['decodeUTF8Input']);
                         $objxAjax->setWrapperPrefix($ajax_conf[AJAX_ENGINE]['wrapper_prefix']);
                         $GLOBALS['objAjax'] = $objxAjax;
                         define('PATH_XAJAX_JS', 'plugin/xajax/');
                         break;
                 }
                 $controller = new controller();
                 $controller->processRequest();
                 if (method_exists($controller, $event)) {
                     $reflectionMethod = new ReflectionMethod('controller', $event);
                     $reflectionMethod->invokeArgs($controller, $params);
                 } else {
                     if ($event != 'default_event') {
                         $msgError = '<div class="error"><b>' . OPF_myLang::getPhrase('ERROR_LABEL') . ':</b>&nbsp;' . OPF_myLang::getPhrase('ROUTER_METHOD_NOT_FOUND') . '&nbsp;&quot;' . $event . '&quot;</div>';
                         die($msgError);
                     }
                 }
                 include $pathIndex;
             } else {
                 $msgError = '<div class="error"><b>' . OPF_myLang::getPhrase('ERROR_LABEL') . ':</b>&nbsp;' . OPF_myLang::getPhrase('ROUTER_CLASS_NOT_FOUND') . '&nbsp;&quot;' . 'controller' . '&quot;</div>';
                 die($msgError);
             }
         } else {
             die('Error: 404 / The module "' . $app . '/' . $module . '" does not exist.');
         }
     }
 }
开发者ID:nextbook438,项目名称:osezno-php-framework,代码行数:50,代码来源:router.php


示例6: __construct

 function __construct()
 {
     parent::__construct();
     $this->model = new mhome();
     $this->view = new vhome();
     //echo 'Hello controller';
 }
开发者ID:carlos195,项目名称:template,代码行数:7,代码来源:home.php


示例7: __construct

 public function __construct()
 {
     parent::__construct();
     include 'controllers/loginController.php';
     $valida = new login();
     $valida->sessao_valida();
 }
开发者ID:suspecie,项目名称:controle-eventos-php-thepowerpuffgirls,代码行数:7,代码来源:homeController.php


示例8: __construct

 function __construct()
 {
     parent::controller();
     parent::database();
     parent::module('models', 'models_auth', 'culck');
     header('Content-type: application/json');
 }
开发者ID:ovarz,项目名称:cobablue,代码行数:7,代码来源:login.php


示例9: getPageInstance

 public static function getPageInstance()
 {
     if (self::$_pageInstance === null) {
         self::$_pageInstance = new yPage();
     }
     return self::$_pageInstance;
 }
开发者ID:alexqwert,项目名称:kanon,代码行数:7,代码来源:controller.php


示例10: __construct

 public function __construct()
 {
     parent::__construct();
     if (empty($_SESSION['auth']) && ACTION_NAME !== 'login') {
         $this->error('跳转至登录页', U('Auth/login'), 3);
     }
 }
开发者ID:PkongStudio,项目名称:Blog,代码行数:7,代码来源:AccessController.class.php


示例11: __construct

 public function __construct()
 {
     parent::__construct();
     include_once $this->config['model'] . 'publicmodel.php';
     log_message("info", "public model included ");
     $this->actmodel = new publicmodel();
 }
开发者ID:jayakrishnancn,项目名称:monsterlab,代码行数:7,代码来源:welcome.php


示例12: array

 function __construct()
 {
     parent::__construct();
     @session_start();
     //$this->view->js_code = '<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>';
     $this->view->js = array('postjob/js/jquery-1.11.3.min.js', 'postjob/js/default.js', 'postjob/js/jquery.fancybox-1.3.4.pack.js', 'postjob/js/jquery.validate.min.js', 'postjob/js/jquery.fancybox.pack.js?v=2.1.5');
 }
开发者ID:vistazp,项目名称:boatseller,代码行数:7,代码来源:postjob.php


示例13:

 function __construct()
 {
     parent::__construct();
     session::init();
     session::loginAuth("comm");
     $this->breadcrumb->add("Commission", "comm");
 }
开发者ID:kronxblue,项目名称:1stg,代码行数:7,代码来源:comm.php


示例14:

 function __construct()
 {
     parent::__construct();
     $this->view->titl = 'Thank You dude!';
     $this->view->canon = 'thanks';
     $this->view->description = 'DotNetNow thanks page';
 }
开发者ID:vistazp,项目名称:boatseller,代码行数:7,代码来源:thanks.php


示例15: create

 /**
  * 添加商家
  * http://localhost/beauty/index.php?m=shop&c=index&a=create
  */
 public function create()
 {
     $data = getParams("data", '');
     $data['created'] = strtotime(date('Y-m-d H:i:s'));
     $result = parent::save($data);
     echo json_encode(array('code' => '0', 'message' => '成功', 'data' => $result));
 }
开发者ID:mustafakarali,项目名称:b2c-1,代码行数:11,代码来源:index.php


示例16: getInstance

 /**
  *
  * Cria uma nova instancia desta classe, e não necessita de um destrutor, pois quando o usuário
  * muda de página, esta instancia é destruída automaticamente.
  * @exemplo $objInstancia = GeralClass::getInstance()->metodoQualquer()
  */
 public static function getInstance()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:nataliajulieta,项目名称:old,代码行数:13,代码来源:controller.php


示例17: __construct

 public function __construct()
 {
     parent::__construct();
     include_once $this->config['model'] . 'login.php';
     log_message("info", "model included ");
     $this->model = new loginModel();
 }
开发者ID:jayakrishnancn,项目名称:monsterlab,代码行数:7,代码来源:login.php


示例18: execute

 public function execute()
 {
     global $application;
     if (!isset($_SESSION['master_email'])) {
         $application->direct('index', false);
     }
     $view = parent::getView();
     $view->set('general->imgkey', rand(1, 7));
     $email = $_SESSION['master_email'];
     $sec_key = $_SESSION['sec_key'];
     $application->database->prepare('SELECT id, look, username, credits, motto FROM server_users WHERE email = ?', array($email));
     $characters = $application->database->execute();
     $widget = ' ';
     while ($c = $characters->to_array()) {
         $w = new widget_object('character-widget');
         $w->set('character->look', $c['look']);
         $w->set('character->motto', $c['motto']);
         $w->set('character->username', $c['username']);
         $w->set('character->credits', $c['credits']);
         $w->set('character->string', base64_encode(sha1($c['id'])));
         $widget = $widget . $w->execute();
     }
     if (strlen($widget) <= 10) {
         $widget = 'No Characters<br><br>';
     }
     $view->set('user->email', $email);
     $view->set('user->seckey', $sec_key);
     $view->set('user->characters', $widget);
     $view->execute();
 }
开发者ID:habb0,项目名称:RaGEWEB3,代码行数:30,代码来源:Characters.php


示例19:

 /**
  * Constructor
  *
  * Requires needed models and helpers.
  * 
  * @access	public
  */
 function __construct()
 {
     parent::__construct();
     $this->load->model('init_model');
     $this->load->model('category_model');
     $this->load->model('article_model');
 }
开发者ID:Bobberty,项目名称:68KB,代码行数:14,代码来源:api.php


示例20: execute

 public function execute()
 {
     global $application;
     if (isset($_GET['user'])) {
         $view = parent::getView();
         $application->database->prepare('SELECT id FROM server_users WHERE username = ?', array($_GET['user']));
         $id = $application->database->execute()->result;
         $key = generate_ticket(array($id, $_GET['user']));
         $application->database->prepare('UPDATE server_users SET client_key = ? WHERE id = ?', array($key, $id));
         $application->database->execute();
         $view->set('user->sso', $key);
         $view->set('rand->number', rand(0, 999));
         $view->execute();
     } else {
         if (!isset($_SESSION['master_email'])) {
             $application->direct('index', false);
             exit;
         } else {
             if (!isset($_SESSION['habbo']['id'])) {
                 $application->direct('characters', false);
                 exit;
             }
         }
         $view = parent::getView();
         $key = generate_ticket(array($application->user->id, $application->user->username));
         $application->user->set_sso($key);
         $view->set('user->sso', $key);
         $view->set('rand->number', rand(0, 999));
         $view->execute();
     }
 }
开发者ID:habb0,项目名称:RaGEWEB3,代码行数:31,代码来源:Client.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP convert类代码示例发布时间:2022-05-23
下一篇:
PHP controlAdminForm类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap