# |
Aug 20th 2019, 19:29 |
daniel.upshaw |
But technically you can do it either way |
# |
Aug 20th 2019, 19:28 |
daniel.upshaw |
For a search filter you might use the query strings like `?s=keywords` |
# |
Aug 20th 2019, 19:28 |
daniel.upshaw |
@maymeow For that case it might make sense to do different routes |
# |
Aug 20th 2019, 18:44 |
pedrorocha |
Hello guys, how do I load a component inside a Listener? I'm implementing an EventListenerInterface and would like to use a custom components I built inside that.. |
# |
Aug 20th 2019, 18:28 |
maymeow |
When you need filter list of items do you use `/controller/index` /controller/another-view` or `/controller/index`, `/controller/index?filter=another-view` For example i need to create page for send / recieved messages |
# |
Aug 20th 2019, 17:36 |
daniel.upshaw |
It should have the same action if it's within the same Controller class |
# |
Aug 20th 2019, 17:35 |
daniel.upshaw |
It refers to ``` private function doThatAction() { }``` |
# |
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 |