# |
Apr 25th 2018, 14:03 |
jotpe |
ah, yeah. Thinking helps :slightly_smiling_face: |
# |
Apr 25th 2018, 14:02 |
dereuromark |
as always? :slightly_smiling_face: when dealing with plugin files maybe? |
# |
Apr 25th 2018, 14:02 |
dereuromark |
setLayout(PluginName.test)? |
# |
Apr 25th 2018, 14:01 |
jotpe |
I use `->setLayout('test')`. When I place the test.ctp file in `src/Template/Layout/Email/text` it's alright. When I place it in `/plugins/MassMailer/src/Template/Layout/Email/text` it's not recognized. Any ideas? |
# |
Apr 25th 2018, 14:00 |
neon1024 |
@dereuromark I haven’t, sorry. |
# |
Apr 25th 2018, 13:58 |
jotpe |
I've got a MissingLayoutException when sending a mit with layout in a plugin. |
# |
Apr 25th 2018, 13:57 |
jotpe |
hey folks, long time no see. |
# |
Apr 25th 2018, 13:32 |
dereuromark |
Did anyone face " possibly out of free disk space " in your cakebox vm? |
# |
Apr 25th 2018, 13:06 |
neon1024 |
Are you all moved to HK already? |
# |
Apr 25th 2018, 13:06 |
neon1024 |
Oh hey hmic! |
# |
Apr 25th 2018, 12:52 |
lorenzo |
yay! |
# |
Apr 25th 2018, 12:39 |
unclezoot |
it works, cheers |
# |
Apr 25th 2018, 12:38 |
unclezoot |
diffInDays? that sounds good will try thanks! |
# |
Apr 25th 2018, 12:38 |
lorenzo |
https://api.cakephp.org/chronos/1.1/class-Cake.Chronos.ChronosInterface.html#_diffInDays |
# |
Apr 25th 2018, 12:37 |
unclezoot |
and adds 'ago' |
# |
Apr 25th 2018, 12:37 |
hmic |
thats it! |
# |
Apr 25th 2018, 12:37 |
unclezoot |
that seems to give weeks and days |
# |
Apr 25th 2018, 12:37 |
lorenzo |
or `diffInDays()`? |
# |
Apr 25th 2018, 12:37 |
hmic |
timeAgoInDays? |
# |
Apr 25th 2018, 12:30 |
unclezoot |
i could just export it into Y-m-D then use php's DateTime but that seems a bit silly |
# |
Apr 25th 2018, 12:29 |
unclezoot |
hi, i have a frozen date and im trying to pull out the number of days ago it was - any ideas? (i just want days, not weeks and days) |
# |
Apr 25th 2018, 12:28 |
eax |
Worked beautifully! Thanks hmic and lorenzo! :) |
# |
Apr 25th 2018, 12:12 |
hmic |
;-) |
# |
Apr 25th 2018, 12:12 |
lorenzo |
:slightly_smiling_face: |
# |
Apr 25th 2018, 12:12 |
eax |
That’s pretty fucking useful! Thanks guys :) Lemme try that out! |
# |
Apr 25th 2018, 12:12 |
hmic |
which differentiates them from callbacks |
# |
Apr 25th 2018, 12:12 |
eax |
Hmm, interesting! Thanks! |
# |
Apr 25th 2018, 12:11 |
lorenzo |
eax you can do $this->MyThings->on(…) |
# |
Apr 25th 2018, 12:11 |
hmic |
thats one of the nice things of events |
# |
Apr 25th 2018, 12:11 |
hmic |
in the add action of said controller |
# |
Apr 25th 2018, 12:11 |
hmic |
just attach it when/where you want it to be |
# |
Apr 25th 2018, 12:11 |
hmic |
eax: no! |
# |
Apr 25th 2018, 12:11 |
eax |
That forces it to happen for all instances of the model being used though |
# |
Apr 25th 2018, 12:10 |
lorenzo |
yeah |
# |
Apr 25th 2018, 12:10 |
hmic |
lorenzo: i don't think it's neccessary to have crud have it itself, can be attached to the tables event as easy... |
# |
Apr 25th 2018, 12:10 |
lorenzo |
you can also create you own action class, I often do that for more complex data transformations |
# |
Apr 25th 2018, 12:09 |
lorenzo |
since in 3.6 you cannot alter the request |
# |
Apr 25th 2018, 12:09 |
hmic |
but the beforemarshal should work fine, like lorenzo said |
# |
Apr 25th 2018, 12:09 |
lorenzo |
maybe it should have a beforeMarshal too |
# |
Apr 25th 2018, 12:09 |
lorenzo |
so it looks to be too late for you |
# |
Apr 25th 2018, 12:09 |
lorenzo |
unfortunately the beforeSave event in crud already gives you an entity |