# |
Jul 8th 2019, 08:23 |
neon1024 |
If it’s covered by the tests, there is probably an issue in my code perhaps a bad namespace |
# |
Jul 8th 2019, 08:23 |
neon1024 |
Well two reasons really, firstly I am working on other bits currently so don’t want to get too into something else mentally, and secondly I don’t have the test suite for the core setup so I can’t easily jump in and run the tests |
# |
Jul 8th 2019, 08:22 |
neon1024 |
It’s covered in the tests cases |
# |
Jul 8th 2019, 08:22 |
neon1024 |
https://github.com/cakephp/cakephp/blob/master/tests/TestCase/Datasource/ModelAwareTraitTest.php#L74 |
# |
Jul 8th 2019, 08:21 |
admad |
why guess when you can find out what's actually going on? :slightly_smiling_face: |
# |
Jul 8th 2019, 08:21 |
neon1024 |
I’ll have a quick look in the tests |
# |
Jul 8th 2019, 08:20 |
neon1024 |
I would guess that `$this->{$alias} = $factory($modelClass);` would be trying `$factory('\App\Model\Table\OrganisationsTable')` |
# |
Jul 8th 2019, 08:19 |
neon1024 |
I don’t see any processing except the `pluginSplit` |
# |
Jul 8th 2019, 08:10 |
admad |
dig into the method and see if the FQCN get split up properly into alias and model type |
# |
Jul 8th 2019, 08:08 |
admad |
hmm actually loadModel() does accetp FQCN too |
# |
Jul 8th 2019, 08:07 |
neon1024 |
Presumably it’s matching on the TableRegistry key then |
# |
Jul 8th 2019, 08:06 |
admad |
loadModel() doesn't accept FQCN |
# |
Jul 8th 2019, 08:05 |
neon1024 |
Bit confusing |
# |
Jul 8th 2019, 08:05 |
neon1024 |
`$this->loadModel(OrganisationsTable::class) // false` `$this->loadModel('Organisations') // OrganisationsTable` |
# |
Jul 8th 2019, 07:01 |
blancessanchez30 |
Thank you :thumbsup: |
# |
Jul 8th 2019, 07:01 |
blancessanchez30 |
I just forgot to add wildcard in declaration in `routes.php` |
# |
Jul 8th 2019, 07:00 |
blancessanchez30 |
Solved it |
# |
Jul 8th 2019, 06:40 |
blancessanchez30 |
Not working |
# |
Jul 8th 2019, 06:33 |
admad |
`return $this->redirect(['controller' => 'admins', 'action' => 'reg_success'])` |
# |
Jul 8th 2019, 06:29 |
blancessanchez30 |
should i declare all controllers and actions in `routes.php`? |
# |
Jul 8th 2019, 06:29 |
blancessanchez30 |
what should i do |
# |
Jul 8th 2019, 06:28 |
blancessanchez30 |
but it only redirects to `/admins/reg_success` |
# |
Jul 8th 2019, 06:27 |
blancessanchez30 |
Made it like this ```return $this->redirect(['controller' => 'admins', 'action' => 'reg_success', $this->Admin->getLastInsertId()]);``` |
# |
Jul 8th 2019, 06:27 |
admad |
then update the URL array accordingly to get `/admin/reg_success` |
# |
Jul 8th 2019, 06:26 |
blancessanchez30 |
and it keeps redirecting to admins |
# |
Jul 8th 2019, 06:26 |
blancessanchez30 |
but the url that i want is admin |
# |
Jul 8th 2019, 06:26 |
blancessanchez30 |
my controller name is admins |
# |
Jul 8th 2019, 06:26 |
blancessanchez30 |
its purpose is to view the newly registered |
# |
Jul 8th 2019, 06:25 |
blancessanchez30 |
its the new ID when admin was registered |
# |
Jul 8th 2019, 06:25 |
admad |
why bother passing `$this->Admin->getLastInsertId()` in the direct array when you only want to redirect to `/admins/reg_sucess`? |
# |
Jul 8th 2019, 06:24 |
blancessanchez30 |
So what should I do to make the routing same as a declared in `routes.php` |
# |
Jul 8th 2019, 06:23 |
admad |
@blancessanchez30 redirect routes are only used for incoming requests. Not redirections using `Controller::redirect()`. |
# |
Jul 8th 2019, 06:15 |
nuzulfikrie |
I see ok |
# |
Jul 8th 2019, 06:14 |
admad |
IMO instead of trying to clear the records on logout you should check and prevent login from same IP |
# |
Jul 8th 2019, 05:52 |
blancessanchez30 |
But when redirecting, it always redirect to ```/admins/reg_sucess/1``` |
# |
Jul 8th 2019, 05:51 |
blancessanchez30 |
And I declared in `routes.php` ```Router::connect('/admin/reg_success', ['controller' => 'admins', 'action' => 'reg_success']);``` |
# |
Jul 8th 2019, 05:50 |
blancessanchez30 |
For example: ` return $this->redirect(['controller' => 'admins', 'action' => 'reg_success', $this->Admin->getLastInsertId()]); ` |
# |
Jul 8th 2019, 05:50 |
blancessanchez30 |
Why does redirect doesn't follow routes which I've declared in routes? |
# |
Jul 8th 2019, 05:35 |
admad |
@nuzulfikrie it's in seconds. The clean is done by PHP itself based values of php.ini values for session garbage collection. Alternately you can just setup a cron to cleanup expired records at regular intervals |
# |
Jul 8th 2019, 04:55 |
nuzulfikrie |
support hi all, just wanna ask when we configure cakephp to store session data inside database. The expires is in what unit? miliseconds? . Plus whenever the user logs out, it did not delete the data inside database. Do i need to manually delete the data? |
# |
Jul 7th 2019, 22:31 |
waspinator |
hmm, so I guess it's a configuration issue. Not sure what it is as the same settings work with gmail |