|
发表于 2014-8-25 17:37:49
|
显示全部楼层
本帖最后由 smallerpig 于 2014-8-25 17:39 编辑
测试环境 windows 8.1 WampServer Version 2.5 CI 2.2.0
Apache Version :2.4.9 - DocumentationPHP Version :5.5.12 - Documentation
Server Software:
Apache/2.4.9 (Win64) PHP/5.5.12
appliction/core/My_Controller.php:
PHP复制代码
<?php
// vim: set expandtab cindent tabstop=4 shiftwidth=4 fdm=marker:
// +----------------------------------------------------------------------+
// | WUXI.SourceCode.Smallerpig |
// +----------------------------------------------------------------------+
// | Copyright (c) 2014, WUXI.SOURCECODE Inc. All rights reserved. |
// +----------------------------------------------------------------------+
// | Authors: smallerpig. www.smallerpig.com |
// | |
// +----------------------------------------------------------------------+
/**
* @version 1.0
* @author smallerpig
* @date
*/
class Console_Controller extends CI_Controller {
function __construct (){
parent ::__construct ();
echo "Console_Controller</br>";
}
}
class Test_Controller extends Console_Controller {
function __construct (){
parent ::__construct ();
echo "Test_Controller</br>";
}
}
复制代码
application/controller/welcome.php
输出结果:localhost/index.php
Console_Controller
Test_Controller
welcome
这不是实现了多层的继承?
|
|