Log message #4187228

# At Username Text
# May 22nd, 09:12 kieran.bowler :thumbsup: @neon1024
# May 22nd, 09:11 kieran.bowler Thanks a lot
# May 22nd, 09:11 kieran.bowler Brill, that did it :slightly_smiling_face: `<?= $this->Form->control('price', ['type' => 'number', 'label' => ['text' => 'Price <span class="note">£</span>', 'escape' => false], 'step' => '0.10', 'value' => number_format( $product->price, 2)]); ?>`
# May 22nd, 09:09 neon1024 Yes, number format! Cast to string :flushed:
# May 22nd, 09:09 kieran.bowler Oooh ok I'll try that
# May 22nd, 09:08 kieran.bowler Can `number_format` be used in the form helper
# May 22nd, 09:08 neon1024 `'value' => number_format($item->get('price', 2)`
# May 22nd, 09:08 neon1024 Or just use `number_format()`?
# May 22nd, 09:08 neon1024 Also, is the value `1.1` or `1.10`? You might need to cast it to a string instead of float
# May 22nd, 09:08 kieran.bowler It's not so much that @neon1024 It's more to do with the full 2 decimal place number displaying
# May 22nd, 09:07 neon1024 Or do you only want rounded to nearest 10p
# May 22nd, 09:07 neon1024 So it can go up in individual pennies?
# May 22nd, 09:07 neon1024 @kieran.bowler Did you try `'step' => '0.01'` ?
# May 22nd, 09:04 kieran.bowler Any help much appreciated
# May 22nd, 09:04 kieran.bowler There's nothing in https://book.cakephp.org/3.0/en/views/helpers/form.html
# May 22nd, 09:01 neon1024 Thanks for looking into the issue with bake :clap:
# May 22nd, 09:01 neon1024 Sorry @dereuromark I must have missed it!
# May 22nd, 09:00 dereuromark @neon1024 I use it to reach phpstan 7 in some plugins. but also in general as safe handler.
# May 22nd, 08:57 kieran.bowler The value is `1.10` in the database too
# May 22nd, 08:57 kieran.bowler I can't find anything in the docs
# May 22nd, 08:57 kieran.bowler Hi all, I'm having trouble getting this to render as `1.10` Here is the code `<?= $this->Form->control('price', ['type' => 'number', 'label' => ['text' => 'Price <span class="note">£</span>', 'escape' => false], 'step' => '0.10']); ?>`
# May 22nd, 08:56 dereuromark morning, I send you sth yesterday in terms of controller request handling
# May 22nd, 08:37 neon1024 Hey everyone :wave:
# May 22nd, 07:54 luisdelamo @admad right
# May 22nd, 07:39 manthan.budheliya Sorry @admad I was out of reach that day I will share things today
# May 22nd, 07:24 welo.lamacchia ahah OK :slightly_smiling_face:
# May 22nd, 07:24 admad I am not going to respond to questions relating to basic PHP :slightly_smiling_face:
# May 22nd, 07:23 welo.lamacchia it's correct?
# May 22nd, 07:23 welo.lamacchia method_exists($event->getSubject(), 'afterSave')
# May 22nd, 07:22 admad method_exists()
# May 22nd, 07:22 welo.lamacchia @admad how i can check if table has afterSave method declared ?
# May 22nd, 07:20 admad @luisdelamo From localized plugin readme: "This plugin also houses translations for the client-facing translated strings in the core (the cake domain). *to use these files link or copy them into their expected location: src/Locale/<locale>/cake.po*"
# May 22nd, 07:18 luisdelamo I try now, and for core translations should be works loading the localized Plugin?
# May 22nd, 07:17 welo.lamacchia if it has afterSave i only change the entity... if not i save the new entity
# May 22nd, 07:16 welo.lamacchia i can check in behavior if table has afterSave method
# May 22nd, 07:15 admad you'll end up with infinite loop if you are not careful about calling save() in afterSave callback
# May 22nd, 07:15 luisdelamo Thanks @admad
# May 22nd, 07:13 welo.lamacchia @admad my problem was that in behavior i call $event->getSubject()->save($entity), so the entity in Table afterSave is not new
# May 22nd, 07:09 admad @luisdelamo you can use $this->loadPlugins() in your testcase class to load required plugin
# May 22nd, 07:07 luisdelamo I try in test folder bootstrap.php use plugin::getcollection:add but not work either
# May 22nd, 07:05 luisdelamo I think is about the plugins now is in Application.php