# |
Jul 12th 2017, 10:12 |
mjabi |
I have installed the CakePHP3.X on ubuntu in sub directory /var/www/html/cake_app, I am using nginx , url rewriting not working, i am accessing the cake app 127.0.0.1/cake_app |
# |
Jul 12th 2017, 09:59 |
davalb |
ok, thanks. I will look into it. |
# |
Jul 12th 2017, 09:47 |
dereuromark |
I also once wanted to do sth like that, never had the time |
# |
Jul 12th 2017, 09:47 |
dereuromark |
There are some 2.x plugins you could look for guidedance, there is also a symfony bundle you could adapt to cake |
# |
Jul 12th 2017, 09:36 |
davalb |
Hello, I am looking for best practices on using a state machine with Cakephp 3.x Do you have a recommendation on which one to use or better yet a blog post about how to integrate a state machine with cakephp? |
# |
Jul 12th 2017, 09:36 |
adriencs |
https://cakesf.slack.com/files/adriencs/F66RJNMEC/UserEntity.php |
# |
Jul 12th 2017, 09:33 |
dereuromark |
others must have the same issue I believe.. |
# |
Jul 12th 2017, 09:33 |
dereuromark |
I should have just stayed in the local timezone :P |
# |
Jul 12th 2017, 09:29 |
neon1024 |
@dereuromark Unfortunatly it’s not something I deal with very often being in the UTC timezone. Except when we do time sensitive stuff in British Summertime |
# |
Jul 12th 2017, 09:29 |
jonasz |
i added there email notification, so you could implement logging to separate file, i presume |
# |
Jul 12th 2017, 09:29 |
slackebot |
'#\\[Cake\\\\.*\\\\(BadRequestException|Missing(Controller|Action)Exception)\\]#' ] ],''' |
# |
Jul 12th 2017, 09:29 |
jonasz |
@birdy247 i created custom handler for logs with additional features: ''' 'Log' => [ 'error' => [ 'className' => 'App\Log\MainLog', 'path' => LOGS, 'file' => 'error', 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], 'url' => env('LOG_ERROR_URL', null), 'scopes' => [], 'email' => '', 'skipEmail' => |
# |
Jul 12th 2017, 09:28 |
neon1024 |
I know that birdy247 was also interested in an elegant solution |
# |
Jul 12th 2017, 09:28 |
neon1024 |
I’m pretty certain than Ionas had a long ticket about the conversion of front-end to back-end timezones |
# |
Jul 12th 2017, 09:27 |
dereuromark |
I have a solution on paper as latest comment, I will try to proof of concept it now. |
# |
Jul 12th 2017, 09:27 |
dereuromark |
Yeah, that is sure one way, but I would like to keep it in core since we got outputtimezone now, and the shipped bootstrap recommends utc here. we need a solid core solution IMO |
# |
Jul 12th 2017, 09:25 |
neon1024 |
I used a data type class |
# |
Jul 12th 2017, 09:21 |
dereuromark |
Displaying is easy, but how to transform back to UTC the proper way? |
# |
Jul 12th 2017, 09:20 |
dereuromark |
See https://github.com/cakephp/cakephp/issues/10877 |
# |
Jul 12th 2017, 09:20 |
dereuromark |
How do other people handle the timezone issue with form inputs for datetime? I still have conversion problems here. |
# |
Jul 12th 2017, 09:20 |
dereuromark |
thats exactly how cake does it in the form helper, too :slightly_smiling_face: |
# |
Jul 12th 2017, 09:19 |
wouter0100 |
Ah, after reading some docs (outside cakephp) I found out the reason. Now using POST method with X_HTTP_METHOD_OVERRIDE. WOrks awesome. |
# |
Jul 12th 2017, 08:57 |
jarard01 |
that's fine - just need to outout to the screen in this format - not my decison |
# |
Jul 12th 2017, 08:57 |
neon1024 |
Or the helper, sure. Didn’t know there was a method in the helper :slightly_smiling_face: TIL |
# |
Jul 12th 2017, 08:57 |
jarard01 |
$this->Number->format |
# |
Jul 12th 2017, 08:56 |
neon1024 |
If you try and do any maths on the value, stuff will break because it has a comma in it ;) |
# |
Jul 12th 2017, 08:56 |
neon1024 |
Do bear in mind that number_format returns a string! |
# |
Jul 12th 2017, 08:56 |
neon1024 |
http://php.net/number_format |
# |
Jul 12th 2017, 08:56 |
neon1024 |
Yes, you can use `number_format()` |
# |
Jul 12th 2017, 08:55 |
jarard01 |
however currency is not quite what I need, is it possible to format 1250 as 1,250 without any currency symbol |
# |
Jul 12th 2017, 08:54 |
jarard01 |
i lied, that does work |
# |
Jul 12th 2017, 08:53 |
neon1024 |
Perhaps the helper isn’t loaded in your AppView.php |
# |
Jul 12th 2017, 08:53 |
jarard01 |
i'm sure i tried that and received an error about a non-oject |
# |
Jul 12th 2017, 08:53 |
neon1024 |
Ah, I see, you can use both! :) |
# |
Jul 12th 2017, 08:53 |
neon1024 |
https://book.cakephp.org/3.0/en/views/helpers/number.html#formatting-currency-values |
# |
Jul 12th 2017, 08:52 |
neon1024 |
Use the helper surely? `$this->Number->currency()` |
# |
Jul 12th 2017, 08:51 |
jarard01 |
hmm that works |
# |
Jul 12th 2017, 08:51 |
anvyst |
@jarard01 try calling it with full namespace, to troubleshoot if you have namespace issue somewhere in the code? Cake\I18n\Number::currency(1.23, 'GBP'); |
# |
Jul 12th 2017, 08:48 |
jarard01 |
in my controller: use Cake\I18n\Number; |
# |
Jul 12th 2017, 08:47 |
jarard01 |
Class 'Number' not found |
# |
Jul 12th 2017, 08:47 |
jarard01 |
in ym template I have: echo Number::currency($price->price, 'GBP'); |