# |
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 |
# |
Jul 7th 2019, 22:12 |
ndm |
@waspinator CakePHP's SMTP transport by default uses the STARTTLS mechanism and will try to use TLS encryption. https://github.com/cakephp/cakephp/blob/3.8.0/src/Mailer/Transport/SmtpTransport.php#L236-L240 |
# |
Jul 7th 2019, 21:48 |
waspinator |
does cake support starttls or only tls? |
# |
Jul 7th 2019, 21:34 |
waspinator |
these settings always results in a SMTP timeout ``` 'default' => [ 'className' => 'Smtp', 'host' => 'smtp.office365.com', 'port' => 587, 'timeout' => 30, 'username' => 'me@mydomain.com', 'password' => 'mypassword', 'client' => null, 'tls' => true, 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null) ], ``` |
# |
Jul 7th 2019, 21:33 |
waspinator |
has anyone tried sending emails using 365 stmp servers? |
# |
Jul 7th 2019, 09:31 |
slackebot |
} ``` updating database is no option at this point as it still serves as datasource for another (older) application in production system |
# |
Jul 7th 2019, 09:31 |
mrfeedback |
any ideas how i can solve this?: in my table i got content with latin_1 encoding. the new app is running under utf-8. when i encode the output of the table into utf8 special chars are broken. i tried to mutate data like this ```protected function _getTitle($title){ if (mb_detect_encoding($title, 'utf-8', true) === false) { $title = mb_convert_encoding($title, 'UTF-8', 'ISO-8859-1'); } return $title; |
# |
Jul 7th 2019, 09:16 |
mrfeedback |
oh! thanks! |
# |
Jul 7th 2019, 09:15 |
vossen.steven |
@mrfeedback https://book.cakephp.org/3.0/en/orm/entities.html#accessors-mutators |
# |
Jul 7th 2019, 09:08 |
mrfeedback |
@challgren can you show me an example? i can´t follow your thought |
# |
Jul 7th 2019, 08:02 |
challgren |
@mrfeedback you can modify the data returned with _getS3key() in your entity |
# |
Jul 7th 2019, 07:32 |
mrfeedback |
or does somebody have any example for this? |
# |
Jul 7th 2019, 07:32 |
mrfeedback |
whats the best way to alternate a resultset? e.g. i have a field `s3key` and I want to replace this field with a presigned url for this request. |
# |
Jul 7th 2019, 07:31 |
mrfeedback |
thanks. yes i did, but i had a typo. so it didnt work on the first try ^^ |
# |
Jul 7th 2019, 06:14 |
ra7bi |
Hey , does cake support auto-load for associated table ? example `Users` hasOne `photo` i want to say each time you query User table also get his photo without writing contain . |
# |
Jul 6th 2019, 21:19 |
challgren |
@mrfeedback did you try `Projects.id`? |
# |
Jul 6th 2019, 18:42 |
graziel |
should work, same error? |
# |
Jul 6th 2019, 18:41 |
mrfeedback |
i tried 'Project.id' => 'DESC' but doesn´t work too |
# |
Jul 6th 2019, 18:39 |
graziel |
multiple column with 'id' name and sql doesnt know which one you mean |
# |
Jul 6th 2019, 18:34 |
mrfeedback |
any ideas why this is returns the error `Integrity constraint violation: 1052 Column 'id' in order clause is ambiguous` ` return $this->find() ->matching('Marketinginfos', function (Query $q) { return $q->where(['closed' => true]); } ) ->order(['id' => 'DESC']) ->limit(50);` |