# |
May 31st 2016, 01:00 |
flashios09 |
just use i18nFormat() |
# |
May 31st 2016, 01:00 |
flashios09 |
in the view when you need convert the var to any format |
# |
May 31st 2016, 00:59 |
flashios09 |
always set the date as object to the view layer |
# |
May 31st 2016, 00:59 |
royalty |
brb |
# |
May 31st 2016, 00:59 |
royalty |
I was messing with the form input templates |
# |
May 31st 2016, 00:59 |
royalty |
i kind of got it but failed at it at the same time, were you able to do it? |
# |
May 31st 2016, 00:59 |
royalty |
I was trying to make cake automagically create datepickers for all date time field |
# |
May 31st 2016, 00:58 |
royalty |
hmmm |
# |
May 31st 2016, 00:58 |
flashios09 |
yes |
# |
May 31st 2016, 00:58 |
royalty |
you do it in the view? |
# |
May 31st 2016, 00:58 |
flashios09 |
inside a controller/model |
# |
May 31st 2016, 00:57 |
royalty |
I thought my code should do it... https://gist.github.com/Modicrumb/b2552300ffe8c67ee63f4ab6512dd491 |
# |
May 31st 2016, 00:57 |
flashios09 |
``` $date_var->i18nFormat('...'); // any format you want to use ``` |
# |
May 31st 2016, 00:57 |
flashios09 |
from object to string(inside the view layer) |
# |
May 31st 2016, 00:56 |
flashios09 |
i have a datepicker too |
# |
May 31st 2016, 00:56 |
flashios09 |
use a method that convert the date to a string |
# |
May 31st 2016, 00:56 |
royalty |
on the edit action |
# |
May 31st 2016, 00:55 |
royalty |
because I am using a datetime picker field instead of the default selects and i want it to populate the field |
# |
May 31st 2016, 00:55 |
royalty |
it keeps returning an object however |
# |
May 31st 2016, 00:55 |
flashios09 |
why ? |
# |
May 31st 2016, 00:54 |
royalty |
i am trying to change this via the getter method in the entity |
# |
May 31st 2016, 00:54 |
royalty |
instead of a date object |
# |
May 31st 2016, 00:54 |
royalty |
suppose i want cakephp to return a string |
# |
May 30th 2016, 23:12 |
LckyBy517 |
doh |
# |
May 30th 2016, 23:12 |
LckyBy517 |
haha nvm read the note XD |
# |
May 30th 2016, 23:02 |
LckyBy517 |
so i'm looking at my data set returned from the awesome stupid query earlier today and notice that all the datasets include the UUID field, is there an easy way to NOT get the UUID column? |
# |
May 30th 2016, 23:00 |
hmic |
im pretty certain as the action is Crud.Index not Crud.index for sure... |
# |
May 30th 2016, 22:57 |
Axel___ |
I will see if this is in fact the issue. But it looks like it is |
# |
May 30th 2016, 22:57 |
hmic |
this is very easy and fast to setup and will help you a lot in this regard |
# |
May 30th 2016, 22:56 |
hmic |
!tell Axel___ about cakebox |
# |
May 30th 2016, 22:56 |
hmic |
my tip: from now on, develop an a system thats as close as possible to the production environment and/or know the implications well! |
# |
May 30th 2016, 22:55 |
hmic |
change to Crud.Index and the problem will be solved - but keep in mind: if you have not *very* strickly sticked to the right casing, you are in trouble and need to fix *lots* of errors like that |
# |
May 30th 2016, 22:55 |
Axel___ |
oh |
# |
May 30th 2016, 22:54 |
hmic |
the windows (and default mac) filesystems are not case sensitive, linux is! |
# |
May 30th 2016, 22:54 |
hmic |
the dev server is linux? |
# |
May 30th 2016, 22:54 |
hmic |
Axel___, a wild guess: your local machine is windows |
# |
May 30th 2016, 22:40 |
Axel___ |
Hi, I have a small question. I have a project locally that works fine with the Crud plugin for cakephp but now on my dev server it throws me an error Could not find action class: Crud.index when trying to map my actions. Have anyone faced this issue before? |
# |
May 30th 2016, 21:32 |
unholyknight |
Yeah, toList was being used after the data was returned. Once I went back through my trace it looked like to likely culprit. |
# |
May 30th 2016, 21:29 |
admad |
so you left out the part which actually mattered in the code you showed above :slightly_smiling_face: |
# |
May 30th 2016, 21:28 |
unholyknight |
@admad looks like toList was the source of it, incorrectly assumed itâ??d properly handle it as key => value pairs |
# |
May 30th 2016, 21:23 |
unholyknight |
@admad tried using keyfield as well, but it isnâ??t working either. are inaccessible fields not allowed to be key fields for lists? thatâ??s the only reason i can come up with as to why itâ??s being ignored. |