# |
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> |
# |
Oct 15th 2019, 09:11 |
jotpe |
In fact, I have this piece of code added to several `$routes->connect`: |
# |
Oct 15th 2019, 09:09 |
slackebot1 |
<jotpe> |
# |
Oct 15th 2019, 09:08 |
jotpe |
I have a route which is `example.com/konferenzen/2020/einreichen/` I used `Router::plugin` and `$routes->scope()` to simplify my routes a bit: |
# |
Oct 15th 2019, 09:04 |
neon1024 |
What’s the use-case? |
# |
Oct 15th 2019, 09:01 |
jotpe |
Is there a way to use `setPatterns`/`setPass` for several Routes or a scope? |
# |
Oct 15th 2019, 09:00 |
jotpe |
Morning |
# |
Oct 15th 2019, 08:58 |
neothermic |
woo |
# |
Oct 15th 2019, 08:57 |
neothermic |
I could just put 3.3.16, because you're not going to release another 3.3 line update :P |
# |
Oct 15th 2019, 08:57 |
dereuromark |
and it is cleaner in terms of semver than using .* :slightly_smiling_face: |
# |
Oct 15th 2019, 08:57 |
dereuromark |
well, still, wrong constraint, `~3.3.0` is the one you needed. |
# |
Oct 15th 2019, 08:57 |
neothermic |
I didn't mistake anything, this was using `composer create-project --prefer-dist cakephp/app:3.3` |
# |
Oct 15th 2019, 08:56 |
dereuromark |
well, you did the mistake of not setting 3rd digit, then ~ would work fine |
# |
Oct 15th 2019, 08:56 |
neothermic |
I had to manually alter the composer.json afterwards to change the `cakephp/cakephp: "~3.3"` line to `cakephp/cakephp: "3.3.*"` |
# |
Oct 15th 2019, 08:55 |
dereuromark |
or you use "~5.5.9" etc and see if that works |
# |
Oct 15th 2019, 08:55 |
dereuromark |
thats how you properly lock it down: https://github.com/dereuromark/cakephp-sandbox/blob/master/composer.json#L123-L125 |
# |
Oct 15th 2019, 08:54 |
neothermic |
I suppose it is! hmm |
# |
Oct 15th 2019, 08:53 |
dereuromark |
thats all correct? |
# |
Oct 15th 2019, 08:51 |
neothermic |
despite the fact that the require line in composer.json has: ``` "require": { "php": ">=5.5.9",``` |
# |
Oct 15th 2019, 08:51 |
neothermic |
install cakephp/app 3.3, and it installs cakephp 3.8.5 ¬_¬ |
# |
Oct 15th 2019, 08:50 |
neothermic |
well, that's fun |
# |
Oct 15th 2019, 08:35 |
dereuromark |
I never do this anti-pattern for usability for this very same reason. |
# |
Oct 15th 2019, 08:35 |
dereuromark |
nope, not properly. Try it out with other messages alongside. |
# |
Oct 15th 2019, 08:11 |
alexdd55976 |
morning |
# |
Oct 15th 2019, 07:54 |
conehead |
Morning |