# |
Oct 15th 2019, 11:25 |
neothermic |
it has `@return string The decoded/processed request data.` which is only true if there's no callback |
# |
Oct 15th 2019, 11:24 |
neothermic |
heh, the `@return` on `ServerRequest::input` is wrong :P |
# |
Oct 15th 2019, 10:42 |
ruth.cantoni |
:slightly_smiling_face: |
# |
Oct 15th 2019, 10:42 |
alexdd55976 |
this is way those folders in they special folders :) |
# |
Oct 15th 2019, 10:40 |
ruth.cantoni |
yes components are for controllers |
# |
Oct 15th 2019, 10:39 |
neothermic |
components are for controllers, beahvoirs are for models. :P |
# |
Oct 15th 2019, 10:39 |
ruth.cantoni |
a plugin as a module actually, but I qould like it to expose some method and my first though was about component: I may be wrong |
# |
Oct 15th 2019, 10:39 |
alexdd55976 |
yes... this is why things could be components/behaviors... some times its a point of view. |
# |
Oct 15th 2019, 10:38 |
neothermic |
they're also more for models, in 2.x speak |
# |
Oct 15th 2019, 10:38 |
neothermic |
like we have behaviours that add in who created/updated a thing (called the ByBehaviour), or does transparent compression of fields (CompressibleBehaviour) or does changelogging |
# |
Oct 15th 2019, 10:37 |
neothermic |
behaviours are, IMO, more for automagic things |
# |
Oct 15th 2019, 10:36 |
alexdd55976 |
could be a component also |
# |
Oct 15th 2019, 10:36 |
alexdd55976 |
depends on hwo things are handled |
# |
Oct 15th 2019, 10:36 |
alexdd55976 |
barcodes, pdfs e.g. i would put them in behaviors.. my first thought at least |
# |
Oct 15th 2019, 10:35 |
neothermic |
if I were re-doing that, I'd possibly implement those under either a custom namespace or keep them as components, depending on how cake-related I need them to be |
# |
Oct 15th 2019, 10:35 |
neothermic |
because putting that into a controller/model/whatever didn't make sense |
# |
Oct 15th 2019, 10:35 |
neothermic |
eg: we have components for emails/letters/labels/pdfs/barcodes |
# |
Oct 15th 2019, 10:34 |
neothermic |
Components are more useful for actions controllers can do that are independent of the controller, or at leas that's what we use them for |
# |
Oct 15th 2019, 10:33 |
alexdd55976 |
that gives me a weird gut feeling though... don't know if makes sense, but does not feel right |
# |
Oct 15th 2019, 10:33 |
alexdd55976 |
A Component as "module"? |
# |
Oct 15th 2019, 10:32 |
ruth.cantoni |
Thanks @neothermic, at the moment I'm oriented towards Components, and I'm using cakePHP 3.8.4. I'll have a try and then tell you if I had success |
# |
Oct 15th 2019, 10:31 |
tippexs91 |
Thanks for the Link. The Problem is not, the validation isn't working. It is working. But how to write a TestCase to prove it is working as expected. Like trying to insert two items with the value in the test-db while executing the unit tests. |
# |
Oct 15th 2019, 10:29 |
neothermic |
I'd say you can do the same with models, but that's a very cake2-isim, in cake3 I'm not 100% sure on table spaces / entities, but I'm mostly sure you can do a similar thing |
# |
Oct 15th 2019, 10:28 |
alexdd55976 |
and there was @neothermic quciker |
# |
Oct 15th 2019, 10:28 |
neothermic |
so we can implement things in AppController that apply to all the controllers in plugins. |
# |
Oct 15th 2019, 10:28 |
neothermic |
Yes; while we've done this in cake 2, I'm sure you can do this in cake3. We have plugins that work roughly like: master AppController plugin [PluginName]AppController (extends AppController) plugin [whatever]Controller (extends [PluginName]AppController) |
# |
Oct 15th 2019, 10:24 |
slackebot1 |
best place in my cakePHP application to put this PHP interface (or, just in case, superclass)? Does this make sense or am I going towards a completely wrong direction? Thanks for any help/hints provided |
# |
Oct 15th 2019, 10:24 |
ruth.cantoni |
Hi all, I'm Ruth, cakePHP newby. I'm about to implement an application made of distinct modules, modules which I want to be able in the future to add/change/delete. I think I'll implement such modules as plugins. Is it possible for plugins components to implement a common (i.e. at application level) interface, or even (not sure yet if I'll need this) extend a common (always meaning at application level) superclass? If so, where is the |
# |
Oct 15th 2019, 09:29 |
ra7bi |
so i do ```patchEnitity($xTbale,$this->request->getData(),[ 'associated=>['Files.Details']``` |
# |
Oct 15th 2019, 09:28 |
ndm |
Use the property names, not the association names, and supply the index if it's needed: `files.12.details._ids` |
# |
Oct 15th 2019, 09:27 |
ra7bi |
also im trying to patchEntity from a table already have a relation with Files table |
# |
Oct 15th 2019, 09:25 |
ra7bi |
details is a relation in files table |
# |
Oct 15th 2019, 09:25 |
ra7bi |
if i want to say ```Files[ '12'=>['details'=>[0=>12,1,23]]]``` how would be the input form would look like i tried ```$this->form->select('Files.Details._ids')``` but not working |
# |
Oct 15th 2019, 09:16 |
jotpe |
Do you have a example how you build up routes in a project? |
# |
Oct 15th 2019, 09:16 |
jotpe |
They just share the same parameters |
# |
Oct 15th 2019, 09:15 |
jotpe |
But I use different Controllers.. |
# |
Oct 15th 2019, 09:14 |
neon1024 |
Plus you end up with this one huge controller method which is trying to deal with lots of incoming routes |
# |
Oct 15th 2019, 09:14 |
neon1024 |
Open routing like that always causes me problems, because it always matches stuff I don’t want it to match |
# |
Oct 15th 2019, 09:14 |
neon1024 |
..but that’s just me |
# |
Oct 15th 2019, 09:14 |
neon1024 |
I don’t like it |
# |
Oct 15th 2019, 09:12 |
slackebot1 |
<jotpe> |