# |
Sep 18th 2019, 20:02 |
ricksaccous |
@henri.mjr not really no, you just have to specify a select form control |
# |
Sep 18th 2019, 19:59 |
henri.mjr |
btw form->control show it as "input", its possible to cake understand it as select automatic? |
# |
Sep 18th 2019, 19:59 |
henri.mjr |
`protected function _getTipo($tipo)` ` {` ` $opcoes = ['Branca','Morena','Negra'];` ` return $opcoes;` ` }` |
# |
Sep 18th 2019, 19:58 |
henri.mjr |
Ok.. I got it on entity |
# |
Sep 18th 2019, 19:31 |
henri.mjr |
I'm googling but no luck |
# |
Sep 18th 2019, 19:31 |
henri.mjr |
Do you have an example for cakephp3? |
# |
Sep 18th 2019, 19:26 |
ricksaccous |
up to you, meh |
# |
Sep 18th 2019, 19:26 |
ricksaccous |
you could even make it a virtual property of your entity if you want |
# |
Sep 18th 2019, 19:25 |
ricksaccous |
replacing X with a more descriptive word |
# |
Sep 18th 2019, 19:25 |
ricksaccous |
$entity->getXOptions |
# |
Sep 18th 2019, 19:25 |
ricksaccous |
i always find it kind of neat to do |
# |
Sep 18th 2019, 19:25 |
ricksaccous |
or put it in your table class |
# |
Sep 18th 2019, 19:25 |
ricksaccous |
you can put a get in your entity if you want |
# |
Sep 18th 2019, 19:24 |
henri.mjr |
I need to "hardcode" some options for few selects.. Like "Hair Color", "Body Type". Where is the best place to put it? |
# |
Sep 18th 2019, 19:02 |
LuizMarin |
url workspace on slack? |
# |
Sep 18th 2019, 19:00 |
royalty |
https://app.slack.com/client/T053DPNCM/C053DPNGT |
# |
Sep 18th 2019, 19:00 |
royalty |
you're better off on slack |
# |
Sep 18th 2019, 18:56 |
LuizMarin |
Is there a way to create a user here? |
# |
Sep 18th 2019, 18:45 |
admad |
"I learned to use debug" most important thing to learn as a coder :slightly_smiling_face: |
# |
Sep 18th 2019, 18:44 |
ricksaccous |
awesome ;) |
# |
Sep 18th 2019, 18:43 |
luiz69 |
By the way, I learned to use debug :) |
# |
Sep 18th 2019, 18:43 |
luiz69 |
find the menu) |
# |
Sep 18th 2019, 18:43 |
luiz69 |
Like I said before, I'm learning. I found the problem. Since no fields were changed, it did not save 'last_ip'. I happened to change a piece of content and it worked fine. I didn't know about this cake concept. |
# |
Sep 18th 2019, 18:38 |
luiz69 |
moment please |
# |
Sep 18th 2019, 18:35 |
royalty |
but you're not |
# |
Sep 18th 2019, 18:34 |
royalty |
you should be getting a white screen or seeing the debugged entity when you try to save now |
# |
Sep 18th 2019, 18:34 |
luiz69 |
I use vscode. It does not show errors. |
# |
Sep 18th 2019, 18:34 |
royalty |
luiz69, everything looks right, what i would try doing is creating a method in your users table and make sure you can call it from your users controller |
# |
Sep 18th 2019, 18:32 |
noel |
Does anyone have recommendations for enforcing style / linting for PHP on Sublime? |
# |
Sep 18th 2019, 18:31 |
luiz69 |
basically it is the code generated by cake. I am learning to change each screen and the internal structure. I want to stay within cake programming conventions |
# |
Sep 18th 2019, 18:27 |
luiz69 |
https://gist.github.com/LuizMarin/201c420bf26844b7dfd4994b465f7db0 |
# |
Sep 18th 2019, 18:25 |
luiz69 |
one moment please. |
# |
Sep 18th 2019, 18:20 |
royalty |
can you gist your users controller and your users table? |
# |
Sep 18th 2019, 18:19 |
luiz69 |
yes, in UsersTable |
# |
Sep 18th 2019, 18:17 |
ricksaccous |
is beforeSave in your table class? |
# |
Sep 18th 2019, 18:17 |
ricksaccous |
then your event is not running |
# |
Sep 18th 2019, 18:16 |
luiz69 |
one moment please. I don't see where debug appears ... |
# |
Sep 18th 2019, 18:13 |
luiz69 |
moment |
# |
Sep 18th 2019, 18:13 |
ricksaccous |
in beforeSave before you run the first line of code do debug($entity); exit; and gist the result |
# |
Sep 18th 2019, 18:12 |
ricksaccous |
or are you sure it's hitting that code? |
# |
Sep 18th 2019, 18:11 |
ricksaccous |
or are you sure it's hitting that code? |