# |
Jun 26th 2019, 16:02 |
michal.ferak |
Hi guys, anyone I could talk to regarding how to properly send a json response (without a view) with a custom code? Here’s a snippet I have, which returns a correct response code, but no data. |
# |
Jun 26th 2019, 16:02 |
slackebot |
<michal.ferak> |
# |
Jun 26th 2019, 14:37 |
dereuromark |
afaik it hooks itself into it, see code. |
# |
Jun 26th 2019, 14:34 |
flxfoo |
Does anyone knows if `session_gc()` would call `DatabaseSession::gc()` |
# |
Jun 26th 2019, 14:33 |
flxfoo |
hi again, |
# |
Jun 26th 2019, 14:21 |
mdotobie |
let me try to pull that together |
# |
Jun 26th 2019, 14:17 |
mdotobie |
thanks @ndm |
# |
Jun 26th 2019, 14:15 |
ndm |
@mdotobie Code examples are always helpful. Show how you're building the form, and explain what it is about the code that you're concerned with, what "defining a structure" means in that context, what these "changes" are and how they affect the form building process, etc... |
# |
Jun 26th 2019, 14:01 |
mdotobie |
(I’m struggling how to succinctly give context to what I’m asking - I’m going to think on it a bit more and come back) |
# |
Jun 26th 2019, 14:00 |
mdotobie |
But I need custom controls, for instance the third dropdown in each row for selecting Revision or Approval is implemented as a method with a `Cell` subclass but should probably be a subclassed `Wdiget` |
# |
Jun 26th 2019, 13:59 |
mdotobie |
I would have liked to use the `_schema` property of the `Form` class but it seems limited to just defining fields for auto-detecting what control type to render with FormHelper. |
# |
Jun 26th 2019, 13:58 |
mdotobie |
My biggest design struggle is around the way I “define” the structure of what eventually becomes the fields |
# |
Jun 26th 2019, 13:57 |
mdotobie |
this is an example. |
# |
Jun 26th 2019, 13:57 |
mdotobie |
https://lpflow.ngrok.io/ns/job/ec6ef907-0914-4ede-82ea-eb8c3e0ef91b/approval/158.1560359754 |
# |
Jun 26th 2019, 13:55 |
mdotobie |
I have a Form that is intended to allow a user to Approve or Request Revision for a group of settings for a Job they’ve placed. |
# |
Jun 26th 2019, 13:54 |
mdotobie |
So I need a bit of architectural advice. I’m trying to redesign a feature of my app to take better advantage of the CakePHP structure because every time I have to make a change it’s a bit of a nightmare to re-approach the code. |
# |
Jun 26th 2019, 12:25 |
admad |
yeah cronjob would be the easiest |
# |
Jun 26th 2019, 12:19 |
flxfoo |
admad: thanks, I did try to play with settings (even making divider=probability with a maxlifetime=1) no deleteAll is called. So I suppose a cronjob has to be set. |
# |
Jun 26th 2019, 11:51 |
admad |
@jeremy.payne you can achieve the same with find('list') too if you read the API and pass it proper options :slightly_smiling_face: |
# |
Jun 26th 2019, 11:49 |
admad |
flxfoo: you need to either set proper values in php.ini so that it runs the session gc at required intervals or clear the db records yourself with a cronjob |
# |
Jun 26th 2019, 11:38 |
jeremy.payne |
Hi all, in Cake2 you could query a model with `->find('list', ['Campaigns.id', 'Campaigns.name', 'Campaigns.channel'])` and it would produce an array with the channel as a key and `[id => name]` as values. I can't seem to get this set up in Cake3. Is this still possible and I am missing something obvious? Thanks :slightly_smiling_face: |
# |
Jun 26th 2019, 11:14 |
flxfoo |
thanks in advance |
# |
Jun 26th 2019, 11:14 |
flxfoo |
I have a question related to cakephp 2, with sessions storesd on a database. Garbage collector does not seem to clear old sessions... Is there a specific thing to setup on cake side (Configure) or use a cronjob to clear old sessions? |
# |
Jun 26th 2019, 11:13 |
flxfoo |
hi all |
# |
Jun 26th 2019, 10:00 |
imonsei |
hm. i'll have to look at this later. off to meeting. le sigh. laters o/ |
# |
Jun 26th 2019, 09:55 |
imonsei |
ooo thanks ndm. that looks interesting |
# |
Jun 26th 2019, 09:53 |
ndm |
https://github.com/WyriHaximus/TwigView/tree/4.3.8#filters |
# |
Jun 26th 2019, 09:52 |
neon1024 |
You could change it before you set it to the view |
# |
Jun 26th 2019, 09:52 |
imonsei |
maybe currentModelName in cakephp's twig have something like currentSingularModelName. time to go become smarter, or dumber. |
# |
Jun 26th 2019, 09:50 |
imonsei |
aw poop. twig doesn't have a filter built in for camelize. people have made some tho |
# |
Jun 26th 2019, 09:49 |
neon1024 |
You’ll have to Google for something which works nativly in Twig |
# |
Jun 26th 2019, 09:49 |
neon1024 |
In Twig? No |
# |
Jun 26th 2019, 09:47 |
imonsei |
oh that works in twig? NEAT! :D |
# |
Jun 26th 2019, 09:47 |
neon1024 |
`Inflector::camelize()` I think |
# |
Jun 26th 2019, 09:46 |
imonsei |
i'm on 3 |
# |
Jun 26th 2019, 09:46 |
neon1024 |
Well, Cake 3 does |
# |
Jun 26th 2019, 09:46 |
neon1024 |
Yes |
# |
Jun 26th 2019, 09:45 |
imonsei |
does cake have a camelize filter for twig, so i can output my classnames correctly in templates? |
# |
Jun 26th 2019, 09:43 |
challgren |
Sometimes I hate kotlin and need to come back to php for a while |
# |
Jun 26th 2019, 09:43 |
challgren |
Ah Im coding trying to finish up the android app Im working on |
# |
Jun 26th 2019, 09:43 |
neon1024 |
Dude, go to bed. |