从CI_Lang子类中的配置文件访问变量

时间:2017-02-06 06:22:43

标签: php codeigniter

我在my_config.php位置创建了一个文件application->config,并在autoload.php中输入了 $autoload['config'] = array('my_config'); 我需要在languages扩展my_config.php的文件MY_Lang.php中访问CI_Lang.php内定义的项$languages = $this->config->item('languages', 'my_config'); 。我的代码如下

Fatal error: Call to a member function item() on a non-object in /var/www/html/my_project/application/core/MY_Lang.php on line 47

但这引发了以下错误

controller

我可以在我的MY_Lang.php文件中这样访问,但不能在 GraphRequest request = GraphRequest.newGraphPathRequest( AccessToken.getCurrentAccessToken(), creatorId, new GraphRequest.Callback() { @Override public void onCompleted(GraphResponse response) { try { Log.e("creatorId's first name:", response.getJSONObject().getString("first_name")); } catch (JSONException e) { e.printStackTrace(); } } }); Bundle params = new Bundle(); params.putString("fields", "id,first_name"); request.setParameters(params); request.executeAsync(); 文件

中访问

0 个答案:

没有答案
相关问题