1. 程式人生 > >學習ThinkPHP3.2.2:video9,用“C”函式讀取配置檔案內容

學習ThinkPHP3.2.2:video9,用“C”函式讀取配置檔案內容

在配置檔案 D:\wamp\www\wish\APP\Home\Conf\config.php 中配置一下內容:

return array(

    //'配置項'=>'配置值'

    'myvar' => 'valueofaaa1'

);

在控制器 D:\wamp\www\wish\APP\Home\Controller\IndexController.class.php 修改index方法:

echo C('myvar');

瀏覽主頁:http://localhost/wish/index.php

顯示:valueofaaa1