# |
Jul 8th 2021, 14:21 |
ndm |
@k4t Yes... just try it |
# |
Jul 8th 2021, 14:18 |
steinkel |
awesome! |
# |
Jul 8th 2021, 14:10 |
ndm |
If you don't need automatic identifier quoting or expression parsing capability, pass the SQL snippet as a single string value: `'(IFNULL(previous_price, price) / price) DESC'`. `orderDesc()` accepts raw SQL too: ```$this->Product ->find() ->orderDesc('IFNULL(previous_price, price) / price')``` |
# |
Jul 8th 2021, 14:04 |
ewbarnard |
Thank you, Jorge! My new co-worker Gary Cartagena will be attending. He and I will be building CakePHP 4.x together. |
# |
Jul 8th 2021, 14:02 |
steinkel |
London tz will be, in ~1h |
# |
Jul 8th 2021, 13:50 |
kupe3b |
hi, with ```$products=$this->Product->find('all',array( 'order'=>array('IFNULL(previous_price,price)/price'=>'DESC') ));``` in the generated SQL i get : ```ORDER BY `IFNULL(previous_price,price)/price` DESC``` how can i order by this little more complex expression? putting quotes around `IFNULL(previous_price,price)/price` generates broken sql |
# |
Jul 8th 2021, 13:30 |
danco.zvezdakoski |
please ignore my messages.. i just got response on the email i sent few minutes ago to the official email. |
# |
Jul 8th 2021, 13:29 |
danco.zvezdakoski |
i should be in the list and should have an email with the session login details, but so far i have nothing in the mailbox. Dont want to miss it... |
# |
Jul 8th 2021, 13:26 |
danco.zvezdakoski |
regarding the upcoming cakephp training session which should happen in 90 minutes... Anyone of the organisers present here? |
# |
Jul 8th 2021, 13:25 |
danco.zvezdakoski |
hello |
# |
Jul 8th 2021, 13:24 |
k4t |
Do CAkePHP HTML Form helper escapes input attributes like value? |
# |
Jul 8th 2021, 13:24 |
k4t |
Hello |
# |
Jul 8th 2021, 13:17 |
ewbarnard |
@steinkel Time zones are hard. Today's training is marked as both GMT and Western European Time, but I think Western European summer time is GMT+1. Is the training time zone currently at 13:16 with training starting at 16:00? |
# |
Jul 8th 2021, 12:01 |
paolo.bragagni |
:) |
# |
Jul 8th 2021, 12:00 |
paolo.bragagni |
it works |
# |
Jul 8th 2021, 12:00 |
ndm |
If your bootstrap is invoked when baking, sure. |
# |
Jul 8th 2021, 11:58 |
paolo.bragagni |
it gets inflector rules from bootstrap.php? |
# |
Jul 8th 2021, 11:55 |
ndm |
But maybe you should it make it view variable instead, like your other variables. |
# |
Jul 8th 2021, 11:54 |
ndm |
The CakePHP twig view has filters for inflection (https://github.com/cakephp/twig-view#extension-filters), so you could do something like `{{ variableName|singularize|underscore }}_id`. |
# |
Jul 8th 2021, 11:49 |
paolo.bragagni |
(while baking?) |
# |
Jul 8th 2021, 11:48 |
paolo.bragagni |
how to use it in twig? |
# |
Jul 8th 2021, 11:48 |
paolo.bragagni |
BUT |
# |
Jul 8th 2021, 11:48 |
paolo.bragagni |
Inflector::rules('irregular', ['lingua' => 'lingue']); |
# |
Jul 8th 2021, 11:48 |
paolo.bragagni |
well |
# |
Jul 8th 2021, 11:48 |
paolo.bragagni |
I use inflectr and it works quite wenn |
# |
Jul 8th 2021, 11:44 |
ndm |
There is always a way for anything, it's just a matter of what lengths one is willing to go to. You get those names either through inflection (https://github.com/cakephp/cakephp/blob/4.2.7/src/Core/ConventionsTrait.php#L48-L61 - the inflector only speaks US english, one can add custom inflections if one wanted to, but it's of course way easier to simply stick to english), or by inspecting possible association configuration. |
# |
Jul 8th 2021, 11:17 |
paolo.bragagni |
language_id from Languages? |
# |
Jul 8th 2021, 11:17 |
paolo.bragagni |
so no way to get lingua_id from Lingue? |
# |
Jul 8th 2021, 11:12 |
paolo.bragagni |
:( |
# |
Jul 8th 2021, 10:55 |
slackebot2 |
!dereuromark-advice |
# |
Jul 8th 2021, 10:55 |
slackebot2 |
Command sent from Slack by dereuromark: |
# |
Jul 8th 2021, 10:51 |
paolo.bragagni |
but I dont find the way to get the 'lingua_id' |
# |
Jul 8th 2021, 10:51 |
paolo.bragagni |
${{ otherPlural }} = $this-{{ currentModelName }}->{{ otherName }}->find('list',['conditions' => ['id' => ${{ singularName }}->lingua_id]]); |
# |
Jul 8th 2021, 10:51 |
paolo.bragagni |
more or less is: |
# |
Jul 8th 2021, 10:50 |
paolo.bragagni |
$lingue = $this->Libri->Lingue->find('list',['conditions' => ['id' => $libro->lingua_id]]); |
# |
Jul 8th 2021, 10:50 |
paolo.bragagni |
In my edit.twig I'd like to make something like this |
# |
Jul 8th 2021, 08:10 |
erwane |
Thanks |
# |
Jul 8th 2021, 07:44 |
dereuromark |
Range() and loop + translation inside a helper |
# |
Jul 8th 2021, 07:26 |
kevin.pfeifer |
You can create a custom view helper if you want |
# |
Jul 8th 2021, 07:20 |
erwane |
There is a simple way to create a select of weekdays ? (monday, tuesday, ..) Except creating an array with all days and pass to options ;) |
# |
Jul 7th 2021, 19:58 |
steinkel |
you can add generic logic to AppController beforeFilter and use `allow` if you check the controller name and action. BUT it would be much better to have the allow per controller in the respective beforeFilter |