# |
May 30th 2017, 01:37 |
royalty |
I'm confused anyway I think I'm going to go get some exercise |
# |
May 30th 2017, 01:36 |
Leonardo_0112 |
royalty, I was using a component, but now I'm putting it on a bahavior |
# |
May 30th 2017, 01:36 |
Leonardo_0112 |
royalty, I'd like to do the same with Banners |
# |
May 30th 2017, 01:36 |
Leonardo_0112 |
royalty, because when I delete product or category, the behavior afterDelete clear all not used images |
# |
May 30th 2017, 01:35 |
royalty |
lol |
# |
May 30th 2017, 01:35 |
royalty |
if you want to do that but not actually afterDelete what's the point |
# |
May 30th 2017, 01:35 |
royalty |
and react to that event |
# |
May 30th 2017, 01:35 |
royalty |
instead you could create another event |
# |
May 30th 2017, 01:35 |
royalty |
why would you ever call it manually? |
# |
May 30th 2017, 01:34 |
Leonardo_0112 |
but seems like it is not working |
# |
May 30th 2017, 01:34 |
Leonardo_0112 |
I'd like to do is: $this->Banner->query('TRUNCATE TABLE banners;'); new CakeEvent('Model.afterDelete', $this); |
# |
May 30th 2017, 01:33 |
Leonardo_0112 |
In Cake 2 can I fire model afterDelete manually? |
# |
May 30th 2017, 01:25 |
royalty |
got it working but that was messy :( |
# |
May 30th 2017, 01:10 |
royalty |
I'll have to edit the widget |
# |
May 30th 2017, 01:10 |
royalty |
I think I know why, I'm simply spitting out the model message for the error instead of calling upon the custom error message I set |
# |
May 30th 2017, 01:09 |
royalty |
hmmmmm |
# |
May 30th 2017, 01:09 |
royalty |
I think what's happening is the options I have given are not being respected |
# |
May 30th 2017, 01:08 |
royalty |
however, the translated version is not showing |
# |
May 30th 2017, 01:07 |
royalty |
and I have errors set up in the field options like: https://gist.github.com/Modicrumb/a86f0efb53d5e03b1a648ea4c424fe0a |
# |
May 30th 2017, 01:02 |
royalty |
I am messing around with displaying errors for the field |
# |
May 30th 2017, 01:02 |
royalty |
so I am trying to build a form widget |
# |
May 30th 2017, 00:25 |
lpj145 |
somebody try use Crud with Cake 3.4 ? |
# |
May 30th 2017, 00:08 |
hiromi2424 |
My understand: set data to entity without patchEntity/newEntity will make entity have inconsistent data. validation and marshal is for set consistent data. |
# |
May 30th 2017, 00:06 |
hiromi2424 |
I don’t think not only for query formatting. It is for set correct data to entity. |
# |
May 30th 2017, 00:02 |
meder_ |
as opposed to more manual? |
# |
May 30th 2017, 00:01 |
meder_ |
like for related tables bound? so it's just an easy way to basically form a query to do an update? |
# |
May 29th 2017, 23:59 |
hiromi2424 |
meder_ not only validation. association objects are initialized e.g. when _ids given |
# |
May 29th 2017, 23:59 |
meder_ |
is patchEntity primarily just used for validation? if so, what's the point of sending validate: false (or equivalent) ? |
# |
May 29th 2017, 23:54 |
hiromi2424 |
*date/datetime |
# |
May 29th 2017, 23:54 |
hiromi2424 |
`setJsonEncodeFormat()` is part of DateFormatTrait |
# |
May 29th 2017, 23:53 |
hiromi2424 |
By default JsonView automatically render data as json such convert data/datetime object to formatted string with cake Cake\I18n\DateFormatTrait |
# |
May 29th 2017, 23:51 |
royalty |
if you are using js to display it you can either just modify it with php beforehand or try using moment.js or something |
# |
May 29th 2017, 23:50 |
royalty |
so you aren't using php to display data? |
# |
May 29th 2017, 23:50 |
hiromi2424 |
@keremcankaya I have experience with changing json date/datetime format: ``` \Cake\I18n\Date::setJsonEncodeFormat("yyyy-MM-dd'T'HH:mm:ssZZZ"); \Cake\I18n\FrozenDate::setJsonEncodeFormat("yyyy-MM-dd'T'HH:mm:ssZZZ"); \Cake\I18n\Time::setJsonEncodeFormat("yyyy-MM-dd'T'HH:mm:ssZZZ"); \Cake\I18n\FrozenTime::setJsonEncodeFormat("yyyy-MM-dd'T'HH:mm:ssZZZ"); ``` in `config/bootstrap.php` |
# |
May 29th 2017, 23:43 |
keremcankaya |
Should i create a view and use the helper or just modify the result set? |
# |
May 29th 2017, 23:43 |
keremcankaya |
I’m actually returning a json response from controller |
# |
May 29th 2017, 23:39 |
dereuromark |
Use the TimeHelper |
# |
May 29th 2017, 23:35 |
keremcankaya |
Is mapping the best way? Feels like there should be an option or an nicer way to format created |
# |
May 29th 2017, 23:35 |
keremcankaya |
Finally I’ve started cake3 however I’m having hard time with returning created in a formatted way |
# |
May 29th 2017, 23:04 |
royalty |
nevermind i got it |
# |
May 29th 2017, 22:48 |
royalty |
how do i pass a value to a validation rule? |