# |
Nov 19th 2019, 10:13 |
dereuromark |
some factory pattern is used inside of the locators. some other ones somewhere else. of course. |
# |
Nov 19th 2019, 10:12 |
kgb.acct.personal |
so, it really depends on the usage? |
# |
Nov 19th 2019, 10:12 |
kgb.acct.personal |
i'm looking for actual use case of patterns |
# |
Nov 19th 2019, 10:12 |
dereuromark |
then there is e.g. "bail early" pattern, "prevent exceptions" for workflow and so on and so on |
# |
Nov 19th 2019, 10:11 |
dereuromark |
depends on the specific type of class. a normal framework uses quite a few. many even. |
# |
Nov 19th 2019, 10:11 |
dereuromark |
why do you ask? |
# |
Nov 19th 2019, 10:11 |
kgb.acct.personal |
Something like builder pattern, singleton, etc |
# |
Nov 19th 2019, 10:11 |
kgb.acct.personal |
Sorry I don't know the correct term |
# |
Nov 19th 2019, 10:11 |
dereuromark |
depends always how you look at it, and at what level |
# |
Nov 19th 2019, 10:10 |
dereuromark |
what kind of question is that? can you be more specific in terms of what pattern you mean? |
# |
Nov 19th 2019, 10:09 |
kgb.acct.personal |
I mean the internal code |
# |
Nov 19th 2019, 10:09 |
challgren |
https://book.cakephp.org/3/en/intro/conventions.html |
# |
Nov 19th 2019, 10:09 |
pieceof |
mvc prg ? |
# |
Nov 19th 2019, 10:08 |
kgb.acct.personal |
What design pattern does CakePHP use? |
# |
Nov 19th 2019, 10:00 |
neon1024 |
You can implement methods in controllers using Crud, and it’ll execute your controller method |
# |
Nov 19th 2019, 09:46 |
noel |
Hi all. I'm working with friendsofcake/crud and jsonapi. I have a desire to create an action on a controller, which is intended to do a custom query lookup. I'm struggling to figure out how to implement this within the CRUD ecosystem. Would I have to create a custom CRUD action class and then load that as a component? Or can I just add an action function to my controller (in which case how do I make it work with crud / jsonapi)? |
# |
Nov 19th 2019, 09:43 |
slackebot |
!tias |
# |
Nov 19th 2019, 09:43 |
slackebot |
Command sent from Slack by challgren: |
# |
Nov 19th 2019, 09:43 |
dereuromark |
Try it yourself with some dangerous snippets and see. |
# |
Nov 19th 2019, 09:42 |
dereuromark |
Jep |
# |
Nov 19th 2019, 09:41 |
mehov |
> if you dont use custom query snippets that means modifying the sql directly, as opposed to using the framework-provided e.g. find or where methods, right? |
# |
Nov 19th 2019, 09:39 |
dereuromark |
If u use my tools plugin you have basic trim. That usually suffices if you dont use custom query snippets. In those cases u need more. |
# |
Nov 19th 2019, 09:37 |
dereuromark |
No it is just a wrapper. Nothing else. |
# |
Nov 19th 2019, 09:30 |
mehov |
Hi everyone, Quick question Does $this->request->getQuery('key') do any filtering/sanitization? And is it safe to put the value directly into $query->where() without any additional sanitization? (As opposed to the good old $_GET where I'm supposed to do all the sanitization myself) |
# |
Nov 19th 2019, 08:40 |
val |
I tried `allowEmptyString()`. Doesn't work for `null` |
# |
Nov 19th 2019, 08:39 |
neon1024 |
As HTML doesn’t post typed data |
# |
Nov 19th 2019, 08:39 |
neon1024 |
I would try `allowEmptyString()` as request data is usually always strings |
# |
Nov 19th 2019, 08:39 |
val |
`allowEmpty()` is deprecated :( |
# |
Nov 19th 2019, 08:39 |
neon1024 |
Although I’m unsure if `integer()` would allow a `null` |
# |
Nov 19th 2019, 08:38 |
neon1024 |
Might need both `allowEmpty` and also `integer()` |
# |
Nov 19th 2019, 08:37 |
val |
Yes something like `?int` but there is no `allowEmptyInt` |
# |
Nov 19th 2019, 08:37 |
challgren |
*Woah* _formatting_ ~options~ |
# |
Nov 19th 2019, 08:37 |
neon1024 |
If you wanted `?string` or `?int` for example |
# |
Nov 19th 2019, 08:37 |
neon1024 |
To constrain a scalar value |
# |
Nov 19th 2019, 08:36 |
neon1024 |
I belive omitting a rule would allow `null` values, as well as `allowEmpty` although some of the empty type rules have been updated in recent releases I think to be things like `allowEmptyArray` or similar |
# |
Nov 19th 2019, 08:35 |
val |
Thanks. Is there a way to allow `null` except using `allowEmpty`? |
# |
Nov 19th 2019, 08:34 |
neon1024 |
https://api.cakephp.org/3.8/class-Cake.Validation.Validator.html |
# |
Nov 19th 2019, 08:33 |
neon1024 |
@val The valiation rules are listed in the api |
# |
Nov 19th 2019, 08:33 |
neon1024 |
Ooh, did *someone* enable _formatting_ options? |
# |
Nov 19th 2019, 08:33 |
neon1024 |
Morning all |
# |
Nov 19th 2019, 08:30 |
javier.villanueva |
morning |