# |
Jul 2nd 2017, 04:36 |
smarty24 |
Reading is important but I am not that type. I get bored after 10 minutes because I am not a faster reader... One of the reasons I dive into coding mostly to avoid bordom |
# |
Jul 2nd 2017, 04:19 |
spencdev |
I can't explain to you how much time I would have saved if I just actually read them |
# |
Jul 2nd 2017, 04:18 |
spencdev |
Read the docs... |
# |
Jul 2nd 2017, 04:17 |
savant |
Do your best! |
# |
Jul 2nd 2017, 04:16 |
savant |
Don’t give up? |
# |
Jul 2nd 2017, 04:16 |
smarty24 |
How are you. I am new to CakePHP or would say haven't started yet although it's on my to do list. Is there any advice I can get? |
# |
Jul 2nd 2017, 03:42 |
savant |
hi |
# |
Jul 2nd 2017, 03:41 |
smarty24 |
Hi I am new here. |
# |
Jul 2nd 2017, 02:26 |
ra7bi |
BTW , Thanks a lot Savant , |
# |
Jul 2nd 2017, 02:25 |
ra7bi |
but if this option is exist , i dont want to duplicate the code |
# |
Jul 2nd 2017, 02:25 |
savant |
there are composer packages that have them as a dependency you can call for |
# |
Jul 2nd 2017, 02:25 |
ra7bi |
im hardcoding the list in some file in my project |
# |
Jul 2nd 2017, 02:25 |
savant |
also doesnt really change that you’re hardcoding the list somewhere |
# |
Jul 2nd 2017, 02:25 |
ra7bi |
Yah correct |
# |
Jul 2nd 2017, 02:24 |
savant |
and that list would get out of date |
# |
Jul 2nd 2017, 02:24 |
savant |
that would mean they’d be hardcoded into the cake core |
# |
Jul 2nd 2017, 02:24 |
ra7bi |
Ah i thought there is an Form element for displaying kind of things |
# |
Jul 2nd 2017, 02:23 |
savant |
put it in the database and issue a find |
# |
Jul 2nd 2017, 02:23 |
ra7bi |
without hardcoding countries as array in controller and then call it from View |
# |
Jul 2nd 2017, 02:22 |
ra7bi |
is there any way to get countries list in the view ? |
# |
Jul 2nd 2017, 02:22 |
ra7bi |
i'v one more question |
# |
Jul 2nd 2017, 02:20 |
ra7bi |
Tks |
# |
Jul 2nd 2017, 02:20 |
ra7bi |
Sure , i'll check it out |
# |
Jul 2nd 2017, 02:19 |
savant |
there is an example there for changing the fields for a find(‘list’) |
# |
Jul 2nd 2017, 02:19 |
savant |
https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#finding-key-value-pairs |
# |
Jul 2nd 2017, 02:18 |
ra7bi |
this is my query |
# |
Jul 2nd 2017, 02:18 |
ra7bi |
``` $diseases = $this->Participants->Diseases->find('list', ['limit' => 200]); ``` |
# |
Jul 2nd 2017, 02:17 |
savant |
ok |
# |
Jul 2nd 2017, 02:17 |
savant |
gist.github.com |
# |
Jul 2nd 2017, 02:17 |
ra7bi |
i will check my find |
# |
Jul 2nd 2017, 02:17 |
savant |
show me the controller code you are using? |
# |
Jul 2nd 2017, 02:17 |
ra7bi |
Oh wait pls |
# |
Jul 2nd 2017, 02:17 |
ra7bi |
Can you please explain more with my example |
# |
Jul 2nd 2017, 02:17 |
savant |
you need to do it at the find level |
# |
Jul 2nd 2017, 02:17 |
savant |
you cant do it from the view |
# |
Jul 2nd 2017, 02:17 |
ra7bi |
Yep how i can change the fields from the view |
# |
Jul 2nd 2017, 02:17 |
savant |
but you can change the find fields to `id`, `eng_name` if you wish |
# |
Jul 2nd 2017, 02:16 |
savant |
by default we pull the primaryKey and the displayField |
# |
Jul 2nd 2017, 02:16 |
savant |
you can change the fields if you wish |
# |
Jul 2nd 2017, 02:16 |
ra7bi |
name for Arabic |
# |
Jul 2nd 2017, 02:16 |
ra7bi |
eng_name is for english language |