# |
Jun 29th 2021, 10:32 |
goranbloncar |
Hey guys! I am using cake4php and I am trying to connect and query data from aws redshift. So I succeed to query data with connectionManager from controller with raw sql. So my question is can I query data with query builder and how can I set default connection to model ( I set defaultConnectionName method) but I am getting: *cannot cast type regclass to character varying* |
# |
Jun 29th 2021, 10:04 |
paolo.bragagni |
when I bake a view it uses the TemplateCommand.php and I can use some variables that I can desume from the code |
# |
Jun 29th 2021, 09:42 |
info315 |
@paolo.bragagni inside of `public function templateData` |
# |
Jun 29th 2021, 09:39 |
paolo.bragagni |
(where are the variables that cake uses ?) |
# |
Jun 29th 2021, 09:38 |
paolo.bragagni |
@admad *twig.symfony.com* this one? |
# |
Jun 29th 2021, 08:28 |
erwane |
Deleting cookie is not the solution |
# |
Jun 29th 2021, 08:27 |
slackebot |
$hasher->hash($user->email . $user->password), ])); $this->setResponse($this->response->withCookie($cookie)); } return $this->redirect($this->request->getParam('here')); }``` |
# |
Jun 29th 2021, 08:27 |
erwane |
There is my solution : // UsersController::securityForm ```if ($this->Users->save($user)) { $this->Flash->success(__('Mot de passe enregistré'), ['key' => 'form']); $cookies = $this->request->getCookieCollection(); if ($cookies->has('remember_me')) { $hasher = new DefaultPasswordHasher(); $cookie = $cookies->get('remember_me') ->withValue(json_encode([ $user->email, |
# |
Jun 29th 2021, 08:14 |
admad |
@paolo.bragagni by reading the twig docs |
# |
Jun 29th 2021, 08:13 |
admad |
@erwane then just delete the cookie |
# |
Jun 29th 2021, 08:06 |
erwane |
@admad i tried this. The user is not in login form at this moment. They are on the security form. One possibilyt is to force logout user. |
# |
Jun 29th 2021, 08:04 |
paolo.bragagni |
@admad please tell me more. how to lean more? |
# |
Jun 29th 2021, 08:03 |
admad |
@info315 he's talking about bake templates, bake does use twig by default :) |
# |
Jun 29th 2021, 08:02 |
admad |
err @erwane |
# |
Jun 29th 2021, 08:02 |
admad |
@ragnarog_online AuthenticationComponent->setIdentity() |
# |
Jun 29th 2021, 08:01 |
info315 |
@paolo.bragagni No, its not |
# |
Jun 29th 2021, 08:01 |
info315 |
@erwane Yes, try to extend the CookieAuthenticator class or just copyandpaste the cookie logic to make protected functions public |
# |
Jun 29th 2021, 07:59 |
erwane |
not on new login. When user password change |
# |
Jun 29th 2021, 07:58 |
paolo.bragagni |
in cake 4 seems that it use twig by default |
# |
Jun 29th 2021, 07:57 |
info315 |
So you only want to renew the cookie on a new login? |
# |
Jun 29th 2021, 07:56 |
erwane |
I did. All this methods are protected. I try the `persistIdentity` but it need checkbox (or fake one) and be on particular login page. I'm trying to fill it manually |
# |
Jun 29th 2021, 07:54 |
info315 |
@erwane You can checkout the CookieAuthenticator: https://github.com/cakephp/authentication/blob/master/src/Authenticator/CookieAuthenticator.php#L135-L136 |
# |
Jun 29th 2021, 07:48 |
info315 |
@paolo.bragagni CakePHP is not using Twig Templates by default. If you want to know more about Twig check out the docs: https://twig.symfony.com/doc/3.x/ |
# |
Jun 29th 2021, 07:45 |
paolo.bragagni |
how to learn twig templating? Trying to get the displayField of associated model but I cant find the way |
# |
Jun 29th 2021, 07:39 |
erwane |
Hi. Someone have a doc or code for `Cakephp/Authentication` when the user change his/her password and need to renew the `remember_me` cookie value ? |
# |
Jun 29th 2021, 07:32 |
conehead |
>vendor\bin\phpcs -i The installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz, Zend, CakePHP, SlevomatCodingStandard and CakePHP Seems to be installed correctly |
# |
Jun 29th 2021, 07:31 |
conehead |
Anyone has seen this error before? Trying to use the CakePHP sniffer: phpcs: ERROR: Referenced sniff "SlevomatCodingStandard.Arrays.TrailingArrayComma" does not exist |
# |
Jun 29th 2021, 07:21 |
dereuromark |
Nmnd: IdeHelper will help u with db columns added. |
# |
Jun 29th 2021, 07:02 |
paolo.bragagni |
how to debug twig variable in cake4 ? |
# |
Jun 29th 2021, 05:32 |
info315 |
Thanks for your feedback, nvm that there is an AssetCompress Plugin |
# |
Jun 28th 2021, 23:08 |
greg138 |
Also, auto-complete in the IDE will let you do `$review->p[ENTER]` instead of `$review->review_p[ENTER]` |
# |
Jun 28th 2021, 23:07 |
greg138 |
I find `$review->published` just fine to read, much better than `$review->review_published` |
# |
Jun 28th 2021, 22:16 |
kevin.pfeifer |
there is a mail tab in the debug kit https://book.cakephp.org/debugkit/3/en/index.html#using-the-mail-panel But as said - the HTML renderer in email clients is worse than you’d expect |
# |
Jun 28th 2021, 22:09 |
kevin.pfeifer |
send it to your own e-mail address and check it in as many email clients as possible ^^ especially HTML mails can be quite difficult to develop so they appear the same in as many different email clients as possible. Thats why there are email template frameworks like MJML |
# |
Jun 28th 2021, 22:06 |
tyler.adam.lazenby |
what is the best way to preview an email that is HTML formatted? |
# |
Jun 28th 2021, 20:56 |
slackebot |
'%'.$search.'%']] ]) ->contain(['Addresses']) ->select(['id', 'first_name','last_name']);``` |
# |
Jun 28th 2021, 20:56 |
japerlman |
Is there a way to have a query do an OR across a relation? I want to have one search box that searches first_name, last_name, and address and when I try to include address I get SQL errors I'm not sure how to include ro OR on the contain I can't find an example of an OR on a contain ``` $query = $this->People->find(); $query ->where([ 'OR' => [['first_name ILIKE' => '%'.$search.'%'], ['last_name ILIKE' => |
# |
Jun 28th 2021, 17:29 |
admad |
Ping to discord |
# |
Jun 28th 2021, 15:35 |
umer936 |
Sweet. I'll let y'all know what I end up going with |
# |
Jun 28th 2021, 15:35 |
umer936 |
@info315 oh I'll check that out too |
# |
Jun 28th 2021, 15:35 |
kevin.pfeifer |
then I would guess the asset-mix plugin is what you need because (as far as I know) the laravel-mix plugin is the easiest way to get started with webpack and therefore have features like tree shaking |