本文整理汇总了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();
}
示例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());
}
示例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);
}
示例4: __construct
/**
*
*/
function __construct()
{
$controller = new controller();
$url = $controller->getUrl();
switch ($url[0]) {
case 'index':
$controller->getIndex();
break;
}
}
示例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> ' . OPF_myLang::getPhrase('ROUTER_METHOD_NOT_FOUND') . ' "' . $event . '"</div>';
die($msgError);
}
}
include $pathIndex;
} else {
$msgError = '<div class="error"><b>' . OPF_myLang::getPhrase('ERROR_LABEL') . ':</b> ' . OPF_myLang::getPhrase('ROUTER_CLASS_NOT_FOUND') . ' "' . 'controller' . '"</div>';
die($msgError);
}
} else {
die('Error: 404 / The module "' . $app . '/' . $module . '" does not exist.');
}
}
}
示例6: __construct
function __construct()
{
parent::__construct();
$this->model = new mhome();
$this->view = new vhome();
//echo 'Hello controller';
}
示例7: __construct
public function __construct()
{
parent::__construct();
include 'controllers/loginController.php';
$valida = new login();
$valida->sessao_valida();
}
示例8: __construct
function __construct()
{
parent::controller();
parent::database();
parent::module('models', 'models_auth', 'culck');
header('Content-type: application/json');
}
示例9: getPageInstance
public static function getPageInstance()
{
if (self::$_pageInstance === null) {
self::$_pageInstance = new yPage();
}
return self::$_pageInstance;
}
示例10: __construct
public function __construct()
{
parent::__construct();
if (empty($_SESSION['auth']) && ACTION_NAME !== 'login') {
$this->error('跳转至登录页', U('Auth/login'), 3);
}
}
示例11: __construct
public function __construct()
{
parent::__construct();
include_once $this->config['model'] . 'publicmodel.php';
log_message("info", "public model included ");
$this->actmodel = new publicmodel();
}
示例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');
}
示例13:
function __construct()
{
parent::__construct();
session::init();
session::loginAuth("comm");
$this->breadcrumb->add("Commission", "comm");
}
示例14:
function __construct()
{
parent::__construct();
$this->view->titl = 'Thank You dude!';
$this->view->canon = 'thanks';
$this->view->description = 'DotNetNow thanks page';
}
示例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));
}