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


PHP controller类代码示例

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


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


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