ci test

下载ci 版本 3.1.9
下载地址 https://www.codeigniter.com/

怎么查看CI的版本信息?想看某个项目中使用的CI具体是哪个版本,怎么查看?
systemcorecodeigniter.php中可以查看版本常量
/**
* CodeIgniter Version
*
* @var string
*
*/
define('CI_VERSION', '3.1.4');

CodeIgniter 主要有 3 个版本:CodeIgniter 3(稳定版)、CodeIgniter 4(开发版)和 CodeIgniter 2(旧版)

配置nginx

server
{
listen 80;
#listen [::]:80;
server_name mysite.yeves.com ;
index index.html index.htm index.php default.html default.htm default.php;
root /www/mysite;

include other.conf;
#error_page 404 /404.html;
include enable-php-pathinfo.conf;
location /{
try_files $uri $uri/ /index.php?s=$uri&$args;
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
include enable-php-pathinfo.conf;
location /{
try_files $uri $uri/ /index.php?s=$uri&$args;
}
}

location ~ .*.(js|css)?$
{
expires 12h;
}

location ~ /.
{
deny all;
}


}


MY_Controller写于core文件夹下 继承CI_Controller

方便不同项目不同的公用处理(CI_Controller写于system下 所有项目共用 一般不做修改)

至于MY_Controller之所以这样命名取决于config/config.php下的subclass_prefix参数设置 默认为MY_

此时一个MY_Controller可能需要更细分到各个项目

此时可在MY_Controller设置多个继承

 在MY_Controller.php中书写多个controller用以不同项目继承

例:

<?php

class MY_Controller extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
    }
}
  
class Weixin_Controller extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
    }
}
  
class Fans_Controller extends MY_Controller
{
    public function __construct()
    {
        parent::__construct();
    }
}
  
?>

原文地址:https://www.cnblogs.com/brady-wang/p/9828605.html