# |
Feb 2nd 2018, 11:39 |
hmic |
i'm ok with extending the crudviewhelper to do it |
# |
Feb 2nd 2018, 11:39 |
hmic |
i just want to change the timeagoinwords application wide |
# |
Feb 2nd 2018, 11:39 |
hmic |
in 20 controllers with total of 50 date fields? |
# |
Feb 2nd 2018, 11:38 |
admad |
hmic: you can use 'formatter' key in field options and use a callback to return the format you want |
# |
Feb 2nd 2018, 11:34 |
hmic |
or can someone enlight me on the proper way to do that? :O |
# |
Feb 2nd 2018, 11:34 |
hmic |
this design is seriously unextendable, very close to broken |
# |
Feb 2nd 2018, 11:33 |
hmic |
well, the next proper solution, to extend the CrudViewHelper in the app and replace the Alias is not working too, as the CrudView decides to load the helpers first, before the ViewBuidler() can inject the helpers that are confiured. no option to configure what CrudView loads *at all* |
# |
Feb 2nd 2018, 11:25 |
rudy1976s |
I have tried to rewrite the route to a more readable link but I think i lost the data posted: do is posible rewrite postLinks routes ? |
# |
Feb 2nd 2018, 11:24 |
rudy1976s |
I created a link using postLink because I need to pass to controller some values in post |
# |
Feb 2nd 2018, 11:23 |
rudy1976s |
good morning! |
# |
Feb 2nd 2018, 10:51 |
hmic |
ooskar1233: i can certainly hack the hell out of it, but i was looking for a proper solution. which does just not exist from what i've seen now. :$ |
# |
Feb 2nd 2018, 10:51 |
neon1024 |
@hmic Oh yeah! Hah, brain fail |
# |
Feb 2nd 2018, 10:49 |
hmic |
it's set in app.php |
# |
Feb 2nd 2018, 10:49 |
neon1024 |
Falls back to server env right? |
# |
Feb 2nd 2018, 10:49 |
LubosR |
Also I see I can't pass multiple args when they are not specified in OptionParser, I am getting Error: Too many arguments. |
# |
Feb 2nd 2018, 10:49 |
ooskar1233 |
@hmic maybe create own view and override `formatTime` and `formatDate`? :slightly_smiling_face: |
# |
Feb 2nd 2018, 10:48 |
neon1024 |
What’s the default for `Configure::read('App.defaultLocale')` |
# |
Feb 2nd 2018, 10:47 |
hmic |
ic, the formatting is hardcoded in the CrudViewHelper to timeAgoInWords() :[ |
# |
Feb 2nd 2018, 10:45 |
LubosR |
Hi there, is it possible to pass array argument to shell subcommand from command line? Might be nonsense, I may use multiple arguments and then use $this->args array, right? |
# |
Feb 2nd 2018, 10:45 |
LubosR |
Hi there, is it possible to pass argument to shell subcommand from command line? Might be nonsense, I may use multiple arguments and then use $this->args array, right? |
# |
Feb 2nd 2018, 10:07 |
arnis |
another question - is it possible to return field instead of a defined variable/value in case statement? For example: ...when discount = true then discounted_price else price... cakephp returns 'discounted_price' or 'price' but not the actual column value |
# |
Feb 2nd 2018, 10:03 |
arnis |
Hi. I have two tabels - products and product_variants (belongsTo to products). Each product_variants row contains a custom price. Can someone help me to figure out how to list all products and sort them by product_variants lowest price? |
# |
Feb 2nd 2018, 10:00 |
hmic |
it's using the "nice" or "human" formatter in the generated views, no matter which format i set in bootstrap and i do need the times in a datetime that just says "2 weeks ago" now :( |
# |
Feb 2nd 2018, 09:59 |
hmic |
anyone using crudview and is able to tell me how to change the output format of date(times)? |
# |
Feb 2nd 2018, 05:44 |
gsitex |
both options are vailable |
# |
Feb 2nd 2018, 04:51 |
turkles |
If I am processing rows in a table and don't want to process anything twice.. better that I have a 'processed' flag? Or just store the last ID after each batch? |
# |
Feb 2nd 2018, 02:21 |
waspinator |
I generated the original pot file using the i18n shell |
# |
Feb 2nd 2018, 02:21 |
waspinator |
and of course my string is wrapped in the `__()` function |
# |
Feb 2nd 2018, 02:19 |
waspinator |
I can't seem to get translated strings to show up. I have a `src/Locale/fr_FR/default.po` file with the `msgid` and translated `msgstr` and I call `I18n::setLocale('fr_FR');`. Right next to the element I call `debug(I18n::getLocale());` and I get `fr_FR`, but the message is still in English. I ran `bin/cake cache clear_all` but it still shows up in English. How can I debug to see if cake is finding the translation? |
# |
Feb 2nd 2018, 01:03 |
gsitex |
This method was auto baked by CakePHP. I have never touched it. |
# |
Feb 2nd 2018, 01:02 |
gsitex |
File uploaded https://cakesf.slack.com/files/U1VHNK3G8/F920PSB1S/error5.jpg / https://slack-files.com/T053DPNCM-F920PSB1S-1909c07411 |
# |
Feb 1st 2018, 23:53 |
ank068 |
Do i need to install memcached for using session in Cakephp 3.x? |
# |
Feb 1st 2018, 21:03 |
etipaced |
I haven’t experienced that but my db and app values are all in UTC. I’m doing timezone conversions in entity accessors. Not sure if that’s best practice, but seems to be working for me. |
# |
Feb 1st 2018, 20:38 |
watermark |
So it seems that chronos sets all dates to utc, even though I have the timezone set in bootstrap. This is causing dates to come out of the database set to utc, which is screwing me. Is there a way to make all dates come out the database in the system timezone? |
# |
Feb 1st 2018, 20:11 |
kailas |
hrm. don’t follow. any pointers in the documentation? |
# |
Feb 1st 2018, 20:08 |
dereuromark |
ideally you have a custom (blob) type set here in your schema, that handles it |
# |
Feb 1st 2018, 19:53 |
kailas |
I have a entity with a blob field. to create a new record, how do I assign a value to the blob? do I need to create a custom setter? or can i just assign whatever data to the field and it’ll save? when i read it’s a file resource and that works, but for my saving it’s just not storing the value I assign to that field |
# |
Feb 1st 2018, 18:40 |
eber |
ow, found out that i don't need to define ids on fixtures... that was the issue... |
# |
Feb 1st 2018, 18:35 |
eber |
can't figure this one out... |
# |
Feb 1st 2018, 18:35 |
eber |
I'm using postgres and fixtures seem to be working just fine but, when I try to save a new record on tests, I get an error saying something about a duplicated id (=1)... |
# |
Feb 1st 2018, 18:34 |
eber |
tks hmic ! I was in a hurry so I removed all those things and kept going with what I could :P now I'm having another weird error ^^ |