csdli 发表于 2014-4-16 17:35:19

你的写法有问题   

csdli 发表于 2014-4-16 17:37:42

<?php if(!defined('BASEPATH')) exit('no access');        class Myclass {                var $CI;                var $_root;                function __construct(){                        $this->CI=& get_instance();                        $this->_root=$this->CI->config->base_url();                }?>

访问的时候:echo $this->myclass->_root;

页: 1 [2]
查看完整版本: 如何创建全局变量