# |
May 18th 2019, 15:38 |
neon1024 |
If you have prefixes and active state per controller + action combo, the conditions can get a bit big and fill up the templating with lots of conditional logic which shouldn’t really be in a template |
# |
May 18th 2019, 15:37 |
neon1024 |
How do people tackle active state in navigation? Do you check in the templating? Check in the View Cell and pass a var to the front-end? Do you use a helper? Or are you using a super clever navigation package? |
# |
May 18th 2019, 12:34 |
waspinator |
https://book.cakephp.org/3.0/en/installation.html#permissions |
# |
May 18th 2019, 10:15 |
snake-venom |
what is the right secure permission for tmp and logs folder ? |
# |
May 18th 2019, 08:36 |
asdf_ |
hi |
# |
May 17th 2019, 20:12 |
challgren |
I’m using MariaDB and Queue dev-master so its not just limited to the 2.x branch |
# |
May 17th 2019, 18:07 |
a.francazi |
yet i still get the same problem |
# |
May 17th 2019, 17:49 |
grzes |
guys pls code-review my latest little package: https://github.com/kminek/url-id :) |
# |
May 17th 2019, 17:47 |
admad |
You wouldn't have to use two method calls like this if were using my Glide plugin :slightly_smiling_face: |
# |
May 17th 2019, 17:43 |
this.impetus |
@admad I must have been drooling on that part of the screen. : / ty |
# |
May 17th 2019, 17:42 |
a.francazi |
@admad ah ok, i'll see to it. thanks |
# |
May 17th 2019, 17:42 |
admad |
@this.impetus the escape options go in the 3rd argument, not in the URL array in 2nd argument |
# |
May 17th 2019, 17:42 |
this.impetus |
It's producing a link with the image URL as the link text |
# |
May 17th 2019, 17:41 |
slackebot |
=> 'Controller', 'action' => 'view', $id ]);``` |
# |
May 17th 2019, 17:41 |
this.impetus |
Afternoon guys. How do you get the HTML helper to allow an image that's also a link? https://api.cakephp.org/3.7/class-Cake.View.Helper.HtmlHelper.html#_link seems to suggest using `escape` and/or `escapeTitle` keys in the link options, but it's not working for me, here's the code: ```$this->Html->link( $this->Thumb->fit($img->path, ['height' => $img->h, 'width' => $img->w]), ['escapeTitle'=> false, 'escape'=> false, 'controller' |
# |
May 17th 2019, 17:41 |
admad |
best way to avoid such problems is set the same timezone for PHP and the MySQL |
# |
May 17th 2019, 17:41 |
admad |
ah i see, in the second case a CakePHP Time object is being created from the datetime string with a differnt timezone |
# |
May 17th 2019, 17:39 |
admad |
it would be possible if in one case the time calculation is done in PHP but not for what you describe |
# |
May 17th 2019, 17:38 |
admad |
@a.francazi how does it give you different when both run on same mysql instance? |
# |
May 17th 2019, 17:38 |
niel45 |
oh,m and is it the same MySQL server also |
# |
May 17th 2019, 17:36 |
niel45 |
i.e. both going through cake? |
# |
May 17th 2019, 17:36 |
niel45 |
@a.francazai, is that using the same connection method? |
# |
May 17th 2019, 17:28 |
a.francazi |
I'm UTC +02:00 btw |
# |
May 17th 2019, 17:27 |
a.francazi |
i have a problem with timezone. if i do `SELECT now() - INTERVAL 1 DAY` on my mysql server it correctly gives me `2019-05-16 19:22:05`. But if I do `$query->newExpr('now() - INTERVAL 1 DAY')` in cakephp it somehow gets `2019-05-16 17:22:05` which is 2 hours off. why's that and where can i change it so it behaves correctly? |
# |
May 17th 2019, 16:05 |
neothermic |
@jeremyharris It doesn't need to do a full table scan if you can give it an index to filter down from at first |
# |
May 17th 2019, 16:04 |
dereuromark |
omg.. @admad I am surprised how easy it was to apply something similar to read() here. But one key difference: It is cleaner if the path is an array here right away: https://github.com/dereuromark/cakephp-dto/pull/22 |
# |
May 17th 2019, 16:02 |
neothermic |
ok, so I've concluded that for anything other than simple singular value extracts, Set::extract and Hash::extract are not 100% compatible with each other |
# |
May 17th 2019, 15:23 |
jeremyharris |
I suppose the query explainer would give me the hard truth |
# |
May 17th 2019, 15:23 |
admad |
i wonder what use case requires exact name matches like the query showed above yields |
# |
May 17th 2019, 15:21 |
jeremyharris |
fair enough :P |
# |
May 17th 2019, 15:21 |
admad |
only if the concatenation is more efficient than one LIKE |
# |
May 17th 2019, 15:20 |
jeremyharris |
side question: from a performance standpoint, would one LIKE be more efficient than 2? I wouldn’t think so since it has to do a full table scan anyway |
# |
May 17th 2019, 15:20 |
martin |
```$user = $this->Users->find()->where(function ($exp, $query) use ($line) { $conc = $query->func()->concat([ 'firstname' => 'identifier', ' ', 'lastname' => 'identifier' ]); return $exp->eq($conc, $line); })->first();``` |
# |
May 17th 2019, 15:19 |
jeremyharris |
I guess if you’re he’s looking for an exact match, I just assumed fuzzy |
# |
May 17th 2019, 15:18 |
admad |
why bother concating? `WHERE first_name like ‘%jeremy%’ OR last_name like ‘%jeremy%’` would yield the same matches |
# |
May 17th 2019, 15:16 |
jeremyharris |
so something like WHERE CONCAT(first_name. ' ‘, last_name) like ‘%jeremy%’ |
# |
May 17th 2019, 15:16 |
martin |
found it |
# |
May 17th 2019, 15:16 |
martin |
oh, yes just started thinking about googleing on concat instead combine :P |
# |
May 17th 2019, 15:15 |
jeremyharris |
concat |
# |
May 17th 2019, 15:15 |
martin |
I’ve users with a firstname and lastname field in database. now I need to search on full name? what is best way to do this? need to combine 2 fields (with space between). I know how to do this in mysql but how do I do it the right way in cake query? |
# |
May 17th 2019, 15:09 |
admad |
i don't but that does look useful |