cakephp-3.2

Fatal error because an Error instance is being passed instead of an expected Exception instance

為{幸葍}努か 提交于 2019-12-02 10:03:48
I just installed xampp with php 7.0.4 and a fresh cakephp 3.2.6. I did a lot of research and everything I found shows that they are compatible. However as soon as I go to open the application with a browser, cake replies with an Internal Error. The only pointer as to what to do is that xampp logs the following in apache error.log: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Cake\Error\BaseErrorHandler::handleException() must be an instance of Exception, instance of Error given in D:\Xampp\htdocs\cakephp\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php:153 Stack trace: #0

Full URLs in emails in CakePHP unittest

孤者浪人 提交于 2019-12-02 07:45:34
问题 I would like to get full URLs inside emails that get triggered by my tests in CakePHP 3.2. I tried with the full-options for $this->Html->image('image.jpg', ['fullBase' => true]) and $this->Url->build('/', true) but they don't seem to work in tests. How can I force full URLs in emails while testing? 回答1: There is no host when running an app in the CLI environment as it's not a web request. You'll have to configure the base URL on your own. Quote from the docs: App.fullBaseUrl The fully

Full URLs in emails in CakePHP unittest

北城余情 提交于 2019-12-02 05:52:31
I would like to get full URLs inside emails that get triggered by my tests in CakePHP 3.2. I tried with the full-options for $this->Html->image('image.jpg', ['fullBase' => true]) and $this->Url->build('/', true) but they don't seem to work in tests. How can I force full URLs in emails while testing? There is no host when running an app in the CLI environment as it's not a web request. You'll have to configure the base URL on your own. Quote from the docs: App.fullBaseUrl The fully qualified domain name (including protocol) to your application’s root. This is used when generating absolute URLs.

Cakephp 3.2 change default date format

扶醉桌前 提交于 2019-11-28 01:38:41
I try to set the default date format of CakePHP 3.2 from dd.mm.YYYY to YYYY-mm-dd , so I will not have to use $MyDatas->mydate->format('Y-m-d') , and what is more important in forms while editing data I will have date in format dd.mm.YYYY (ex- 27.02.2016). I need YYYY-mm-dd (2016-02-27). I looked for solutions and none display any changes (in forms or as part of view: $MyDatas->mydate ): // in AppController ini_set('intl.default_locale', 'pl_PL'); //and/or use Cake\Database\Type; Type::build('datetime')->useLocaleParser()->setLocaleFormat('YYYY-mm-dd'); //and/or use Cake\I18n\I18n; I18n:

Cakephp 3.2 change default date format

独自空忆成欢 提交于 2019-11-27 04:48:14
问题 I try to set the default date format of CakePHP 3.2 from dd.mm.YYYY to YYYY-mm-dd , so I will not have to use $MyDatas->mydate->format('Y-m-d') , and what is more important in forms while editing data I will have date in format dd.mm.YYYY (ex- 27.02.2016). I need YYYY-mm-dd (2016-02-27). I looked for solutions and none display any changes (in forms or as part of view: $MyDatas->mydate ): // in AppController ini_set('intl.default_locale', 'pl_PL'); //and/or use Cake\Database\Type; Type::build(