我很难在代码点火器3中将DateTime库碳库集成到我的项目中,我尝试过这样做
$this->load->library('carbon');它给了我一个错误
not existing class我认为问题在于名称空间,因为碳使用名称空间碳\碳
提前谢谢你。
发布于 2018-02-15 07:21:03
简单的步骤:
发布于 2018-09-01 12:59:01
以下是Codeigniter 3的另一种方法:
- Open the terminal
- Go to the root folder of your Codeigniter project and type: composer require nesbot/carbon ^2
- It should install Carbon 2.x in the _**vendor/nestbot/Carbon**_ folder
- Remove the `ˆ2` to install the latest 1.x version (when writing this answer)
- Open _**application/config/config.php**_ and change: $config['composer\_autoload'] = FALSE;to:$config‘’composer_autoload‘= FCPATH.'/vendor/autoload.php';
- Create the _**application/libraries/Carbon\_lib.php**_ file:有关更多详细信息,请参阅碳网站。
发布于 2021-01-07 11:43:34
按照Codeigniter 3的步骤执行:
现在你可以使用碳功能了。示例:
Carbon::now();https://stackoverflow.com/questions/38807029
复制相似问题