|
楼主 |
发表于 2013-9-5 09:24:41
|
显示全部楼层
本帖最后由 geomen 于 2013-9-5 09:29 编辑
比如我根据手册上写的
PHP复制代码 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index ()
{
$query = $this->db->get('design');
foreach($query->result() as $row){
echo $row->name;
}
//$this->load->view('welcome_message');
}
public function message ($to="world"){
$query = $this->db->get('design');
echo $query->num_fields().PHP_EOL ;
echo "hello {$to}!".PHP_EOL ;
}
} 复制代码
在网页上,第一个和第二个都能显示,
http://localhost/capaerp/capa/ci.php/welcome/message j显示:42 hello world!
http://localhost/capaerp/capa/ci.php/welcome/index 显示:
测试8测试六tes5测试1test4test6123测试1test2test12324d123123438888323tettt3232yyyyyyyu32333hhhffff一下子123123444444444444555
然后,我用命令行:
php ci.php welcome/message
就只显示 hello world 了 |
|