# |
Aug 20th 2019, 17:35 |
ckjksl |
awesome, i'll give that a shot then. Thanks! |
# |
Aug 20th 2019, 17:35 |
daniel.upshaw |
Yep it does @ckjksl |
# |
Aug 20th 2019, 17:23 |
ckjksl |
that would work out, but would it have access to all the same `$this` as my other functions? like `$this->autoRender = false;` |
# |
Aug 20th 2019, 17:22 |
ckjksl |
does ` $this->doThatAction();` refer to another function inside my controller? |
# |
Aug 20th 2019, 17:19 |
ckjksl |
one of them has almost two hundred lines of code, so it's a bit hard to manage |
# |
Aug 20th 2019, 17:18 |
ckjksl |
The switch statement is what's working right now, but it's getting close to having more than eight `$action`s. |
# |
Aug 20th 2019, 17:13 |
daniel.upshaw |
Rather than connecting a route for each tag and trying to pass the tag in the route URL |
# |
Aug 20th 2019, 17:13 |
daniel.upshaw |
`$routes->connect('/:tag')->setPatterns([':tag' => 'piped|list|of|valid|tags'])` |
# |
Aug 20th 2019, 17:12 |
daniel.upshaw |
The only way I could find to reliably pass both indexed and associative to a controller method is to not use index |
# |
Aug 20th 2019, 17:07 |
daniel.upshaw |
```switch ($action) { case 'thisaction' : $this->doThisAction(); break; case 'thataction' : $this->doThatAction(); break; }``` |
# |
Aug 20th 2019, 17:06 |
daniel.upshaw |
You could have a `switch` statement and call different private methods? |
# |
Aug 20th 2019, 17:05 |
daniel.upshaw |
Oooh the `action` arguments performs different things in the method depending on what is passed to that one |
# |
Aug 20th 2019, 17:05 |
daniel.upshaw |
How are you routing to it? |
# |
Aug 20th 2019, 17:05 |
daniel.upshaw |
@ckjksl You're saying that the `manageProject` action has an increasing number of arguments? |
# |
Aug 20th 2019, 16:58 |
ckjksl |
I have a controller that takes a couple arguments: `public function manageProject ($pcode = null, $action = null, $arg = null)` It used to be only two actions, but now it's getting out of control. Is there a way to separate it into different controller functions so that they're easier to manage? |
# |
Aug 20th 2019, 16:48 |
daniel.upshaw |
Arg but it still passes them in indexed... so the action can't use an indexed passed parameter mixed with named ones |
# |
Aug 20th 2019, 16:42 |
daniel.upshaw |
I found that by guessing... the docs mention `$this->request->getParam('pass')` which returns indexed |
# |
Aug 20th 2019, 16:41 |
daniel.upshaw |
Oh! Seems to be possible with `->getParam($passedName)` |
# |
Aug 20th 2019, 16:38 |
daniel.upshaw |
Trying to find a way to use "named pass," associative |
# |
Aug 20th 2019, 16:38 |
daniel.upshaw |
Both using `->setPass()` and adding to the URL array |
# |
Aug 20th 2019, 16:38 |
daniel.upshaw |
They seem to come in indexed, so it's hard to predict what the variables will be |
# |
Aug 20th 2019, 16:37 |
daniel.upshaw |
If the same Controller action has some optional arguments |
# |
Aug 20th 2019, 16:37 |
daniel.upshaw |
Passing parameters in routes seems to be a bit confusing |
# |
Aug 20th 2019, 16:33 |
graziel |
you can check whats possible with `bin/cake bake migration --help` |
# |
Aug 20th 2019, 16:29 |
lpj145 |
not can be create with bake command ? |
# |
Aug 20th 2019, 16:28 |
ricksaccous |
@lpj145 you can easily create migrations in a plugin path but apart from that you can just create them and move them wherever you want |
# |
Aug 20th 2019, 16:13 |
lpj145 |
@deal have a release time to 4x ? |
# |
Aug 20th 2019, 16:13 |
lpj145 |
with "cake bake migration MigrationName " |
# |
Aug 20th 2019, 16:13 |
lpj145 |
hi guy's.... someone know how i can create migration in another path ? |
# |
Aug 20th 2019, 15:30 |
ricksaccous |
lol |
# |
Aug 20th 2019, 15:30 |
ricksaccous |
i'm thinking if he doesn't budge at first i'll offer to pay for the plane ride myself/etc until he's like OKAY FINE GO |
# |
Aug 20th 2019, 15:29 |
alexdd55976 |
i tried that too... received a good laugh |
# |
Aug 20th 2019, 14:22 |
ricksaccous |
i need to convince my manager/boss it sounds like a fun trip |
# |
Aug 20th 2019, 14:21 |
dereuromark |
not sure yet |
# |
Aug 20th 2019, 14:19 |
ricksaccous |
@dereuromark are you going to Japan? |
# |
Aug 20th 2019, 14:19 |
dereuromark |
huhu, cake4 project (app) is now level 7 in phpstan :slightly_smiling_face: https://github.com/cakephp/app/blob/4.x/phpstan.neon |
# |
Aug 20th 2019, 13:39 |
jiri.sejhar |
if i have tree and update o item which is bettween others at first place and i update this item this item is now at last place in the branch in sql there is something strange . Why? UPDATE customers SET lft = ( (lft + -2) ) WHERE ( lft BETWEEN 3 AND 4 ) |
# |
Aug 20th 2019, 13:31 |
martin |
:P |
# |
Aug 20th 2019, 13:23 |
ricksaccous |
international love |
# |
Aug 20th 2019, 13:23 |
ricksaccous |
woah woah woah woah |
# |
Aug 20th 2019, 13:22 |
martin |
hope we have no short plans to go international :P |