# |
Jun 28th 2017, 10:44 |
neon1024 |
I do the same thing for user dropdowns where I want user_id => first_name + last_name |
# |
Jun 28th 2017, 10:43 |
neon1024 |
Then your virtual field can be your three things concatenated with a hyphen |
# |
Jun 28th 2017, 10:43 |
vix |
:,) |
# |
Jun 28th 2017, 10:42 |
neon1024 |
https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#customize-key-value-output |
# |
Jun 28th 2017, 10:42 |
neon1024 |
Well find(‘list’) can take options |
# |
Jun 28th 2017, 10:42 |
neon1024 |
Also, minor, but your code wouldn’t be valid CakePHP coding style :P |
# |
Jun 28th 2017, 10:42 |
vix |
Could u pls help me out. As m not getting perfect answer to that |
# |
Jun 28th 2017, 10:41 |
neon1024 |
Also, did you know about https://github.com/friendsofcake/bootstrap-ui |
# |
Jun 28th 2017, 10:41 |
neon1024 |
I’d use a virtual property for that |
# |
Jun 28th 2017, 10:40 |
neon1024 |
Perhaps, https://cdn.shopify.com/s/files/1/1061/1924/files/Strawberry_Cake_Emoji.png?9898922749706957214 |
# |
Jun 28th 2017, 10:39 |
savant |
should have been called CakePHP Naruto 4.0 |
# |
Jun 28th 2017, 10:39 |
neon1024 |
We need an actual strawberry cake emojii I feel |
# |
Jun 28th 2017, 10:39 |
savant |
:fish_cake: |
# |
Jun 28th 2017, 10:39 |
savant |
:strawberry: |
# |
Jun 28th 2017, 10:39 |
savant |
Strawberry ShortCake 4.0 on top |
# |
Jun 28th 2017, 10:39 |
neon1024 |
notEmpty(field, message, mode) vs requirePresence(field, mode, message) |
# |
Jun 28th 2017, 10:38 |
adriencs |
? |
# |
Jun 28th 2017, 10:38 |
neon1024 |
I wonder if 4.0 will fix notEmpty vs requirePresence param order |
# |
Jun 28th 2017, 10:37 |
adriencs |
:strawberry: |
# |
Jun 28th 2017, 10:37 |
neon1024 |
->displayField will work, but is deprecated, so will not work when upgrading to 4.0 Strawberry Cake |
# |
Jun 28th 2017, 10:37 |
vix |
ohk sending |
# |
Jun 28th 2017, 10:36 |
adriencs |
link to the doc ? |
# |
Jun 28th 2017, 10:36 |
neon1024 |
Only in 3.4+ |
# |
Jun 28th 2017, 10:36 |
vix |
in cakephp 3 its ->setDisplayField |
# |
Jun 28th 2017, 10:36 |
adriencs |
isnt `->displayField` and not `->setDisplayField` ? |
# |
Jun 28th 2017, 10:36 |
vix |
ohk explaining in brief |
# |
Jun 28th 2017, 10:35 |
adriencs |
@vix don't know what are you talking about |
# |
Jun 28th 2017, 10:34 |
marcobimbati-cakephp |
That's great! I'll fiddle with my code a bit to try a few things and learn |
# |
Jun 28th 2017, 10:33 |
adriencs |
you can even do `Predictions => ['Matches.Players']` |
# |
Jun 28th 2017, 10:33 |
adriencs |
`Predictions.Matches` = `Predictions => ['Matches']` |
# |
Jun 28th 2017, 10:33 |
vix |
please help ->setDisplayField in model with 3 fields. In HTML Select its showing A;B;C . How to get rid of this semi colon? |
# |
Jun 28th 2017, 10:32 |
adriencs |
work like an array |
# |
Jun 28th 2017, 10:32 |
adriencs |
you can use dot notation in many places, usefull |
# |
Jun 28th 2017, 10:31 |
adriencs |
you welcome |
# |
Jun 28th 2017, 10:31 |
marcobimbati-cakephp |
Thank you again! |
# |
Jun 28th 2017, 10:31 |
marcobimbati-cakephp |
Oh, excellent |
# |
Jun 28th 2017, 10:30 |
marcobimbati-cakephp |
Ok, clear. What if I'll need multiple contains one day? |
# |
Jun 28th 2017, 10:28 |
marcobimbati-cakephp |
@adriencs it worked! Thanks! :) |
# |
Jun 28th 2017, 10:28 |
adriencs |
you can use the dot if you need to contain only one thing |
# |
Jun 28th 2017, 10:28 |
savant |
maybe |
# |
Jun 28th 2017, 10:27 |
savant |
$user = $this->Users->get($id, [‘contain’ => [‘Predictions’ => [‘contain’ => [‘Matches’]]]]); |