Class 'Locale' not found - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Class 'Locale' not found (/showthread.php?tid=76538) Pages:
1
2
|
Class 'Locale' not found - maaa.om - 05-22-2020 Dear All, Actually I'am trying to get created_at and updated_at from my model PHP Code: $model->created_at But I got error "Class 'Locale' not found", I search a lot about this, and I sow it's some thing regarding "intl extension" in php environment, I tried a lot to install it with mac xampp 7.4.4, but with no result. Any Idea how I can call created_at and updated_at from my model without getting this error? Thanks RE: Class 'Locale' not found - maaa.om - 05-25-2020 Any updates developers ? RE: Class 'Locale' not found - dave friend - 05-26-2020 You need to show the code you're using before advice can be offered. RE: Class 'Locale' not found - maaa.om - 05-26-2020 (05-26-2020, 06:05 AM)dave friend Wrote: You need to show the code you're using before advice can be offered. In my Entity: PHP Code: <?php namespace App\Entities; In my Controller: PHP Code: <?php In My Model: PHP Code: <?php In My View: PHP Code: foreach($tasks as $key => $task) RE: Class 'Locale' not found - vitnibel - 05-26-2020 This error occurs if there is no installed intl extension specified in the system requirements. Server Requirements Class Locale RE: Class 'Locale' not found - maaa.om - 05-26-2020 (05-26-2020, 09:35 AM)vitnibel Wrote: This error occurs if there is no installed intl extension specified in the system requirements.I search a lot about this, and I sow it's some thing regarding "intl extension" in php environment, I tried a lot to install it with mac xampp 7.4.4, but with no result. Any Idea how I can call created_at and updated_at from my model without getting this error? RE: Class 'Locale' not found - vitnibel - 05-26-2020 If, with the constructor of the Time class, all parameters are passed explicitly, then most likely the call to the Locale :: getDefault () function due to which an error occurs can be avoided. PHP Code: class Time { RE: Class 'Locale' not found - maaa.om - 05-26-2020 (05-26-2020, 09:59 AM)vitnibel Wrote: If, with the constructor of the Time class, all parameters are passed explicitly, then most likely the call to the Locale :: getDefault () function due to which an error occurs can be avoided. What I should to do now? RE: Class 'Locale' not found - vitnibel - 05-26-2020 Do not call the function mutateDate(), but create the Time object explicitly based on the data format in the database. For example, this way you can avoid calling a function of the Locale class. PHP Code: $this->attributes['created_at'] = new Time($this->attributes['created_at'], 'UTC', 'en-US'); RE: Class 'Locale' not found - maaa.om - 05-26-2020 (05-26-2020, 10:34 AM)vitnibel Wrote: Do not call the function mutateDate(), but create the Time object explicitly based on the data format in the database. Now I got diffrent error (Class 'IntlDateFormatter' not found) PHP Code: public function __toString(): string |