# |
Apr 26th 2018, 07:29 |
admad |
gonna be a steep learning curve for you if you are new to PHP itself |
# |
Apr 26th 2018, 07:28 |
admad |
@lutepluto get if from here https://github.com/cakephp/app/tree/master/bin or just use a proper webserver :slightly_smiling_face: |
# |
Apr 26th 2018, 07:22 |
lutepluto |
Hi everyone. I take over a project which is built on CakePHP 3.1, but I'm fresh on both PHP and CakePHP. I just want to know how can I start the CakePHP built-in dev server without bin/cake cause there's no bin folder in the repo. Sorry for this silly question...:disappointed_relieved: |
# |
Apr 26th 2018, 06:54 |
mendoza.anthony.g |
Thanks man. |
# |
Apr 26th 2018, 06:54 |
joshualuckers |
https://www.startutorial.com/articles/view/preview-email-with-debugkit-in-cakephp-3 |
# |
Apr 26th 2018, 06:52 |
mendoza.anthony.g |
hi, i have ctp file under Template > Email > html. How can I view it in the browser to test the design? |
# |
Apr 26th 2018, 06:24 |
saeideng |
`$post->id` |
# |
Apr 26th 2018, 01:14 |
saltlake |
if ($this->Posts->save($post)) { id after saving this post |
# |
Apr 26th 2018, 01:14 |
saltlake |
How can I get the id of saved record? |
# |
Apr 26th 2018, 01:02 |
mendoza.anthony.g |
@itmpls hi sir, thanks for your help, may i know how this API work? |
# |
Apr 26th 2018, 00:57 |
jbehling |
I resolved. Thanks |
# |
Apr 26th 2018, 00:56 |
jbehling |
File uploaded https://cakesf.slack.com/files/U4JNYBNCW/FAD8PLW9Z/-.php / https://slack-files.com/T053DPNCM-FAD8PLW9Z-7abbce80f0 |
# |
Apr 26th 2018, 00:54 |
slackebot2 |
$this->Form->create() ?> <?= $this->Form->control('email') ?> <?= $this->Form->control('password') ?> <?= $this->Form->submit(__('Login')) ?> <?= $this->Form->end() ?>` |
# |
Apr 26th 2018, 00:54 |
slackebot2 |
return $this->redirect($this->Auth->redirectUrl()); } else { $this->Flash->error(__d('Accounts/auth', 'You need to activate your account to sign in')); return; } } $this->Flash->error(__d('Accounts/auth', 'Invalid username or password, try again')); } }` In My template login.ctp `<?= $this->Flash->render('auth') ?> <?= |
# |
Apr 26th 2018, 00:54 |
slackebot2 |
function login() { if ($this->request->is('post')) { $this->Auth->setConfig('authenticate', [ 'Form' => [ 'fields' => ['username' => 'email'], ] ]); $this->Auth->constructAuthenticate(); $user = $this->Auth->identify(); if ($user) { if ($user['active']) { $this->Auth->setUser($user); |
# |
Apr 26th 2018, 00:54 |
jbehling |
Good evening, I want to create a login system where the user will enter the email and the password. I'm using the AuthComponent. But it does not work. Does anyone know the problem? Code below In my AppController.php `$this->loadComponent('Auth', [ 'authenticate' => [ 'Form' => [ 'fields' => ['username' => 'email'] ] ], ]);` In My UsersController.php `public |
# |
Apr 26th 2018, 00:29 |
saltlake |
HI all |
# |
Apr 25th 2018, 22:20 |
dereuromark |
For those that have been missing the 2.x web test runner (+ test case generation from web gui alias browser), I have been doing a some experimenting: https://github.com/dereuromark/cakephp-test-helper/releases/tag/0.1.0 |
# |
Apr 25th 2018, 20:44 |
madrid988 |
and those appear to be the 2 default formats as per the link you posted. |
# |
Apr 25th 2018, 20:44 |
madrid988 |
What is strange is that when I try saving with dates as a string formatted like '2018-01-01 00:00:00', or '2018-01-01T01:01:01PM' I still get an error |
# |
Apr 25th 2018, 20:41 |
dereuromark |
also refs https://github.com/cakephp/cakephp/issues/10439 |
# |
Apr 25th 2018, 20:38 |
admad |
https://github.com/cakephp/cakephp/blob/master/src/Database/Type/DateTimeType.php#L71 |
# |
Apr 25th 2018, 20:35 |
madrid988 |
my database type is 'timestamp without time zone' |
# |
Apr 25th 2018, 20:34 |
madrid988 |
my json content sends the datetimes as string like '2018-01-01T00:00:00' and am looking for the best way to have this conversion done through my app for all datestimes |
# |
Apr 25th 2018, 20:33 |
madrid988 |
I am attempting to save a date/time with no timezone. |
# |
Apr 25th 2018, 20:33 |
madrid988 |
what if I am saving my timestamps which do have the time part? |
# |
Apr 25th 2018, 20:32 |
admad |
you'll have to use a custom date db type class to strip out the timezone when marshalling |
# |
Apr 25th 2018, 20:32 |
admad |
calendar dates don't have timezone |
# |
Apr 25th 2018, 20:30 |
madrid988 |
When I try 'date_of_birth'=>'2018-01-01' it works but 'date_of_birth'=>'2018-01-01T00:00:00' does not work as it give a 'the provided value is invalid' error when I try to save. Any ideas on how to have Cake work for saving timestamps as '2018-01-01T00:00:00' or some kind of format which includes the time part? |
# |
Apr 25th 2018, 19:31 |
madrid988 |
i will do that |
# |
Apr 25th 2018, 19:27 |
dereuromark |
foreach ().. $row['created'] = new Time($row['created']); |
# |
Apr 25th 2018, 19:26 |
dereuromark |
I had a similar issue and had to convert manually |
# |
Apr 25th 2018, 19:20 |
madrid988 |
I'm guessing if I passed in my datetime as different inputs like mydate[month] mydate[day] etc... it would work, but is there a way to just send a date string instead? |
# |
Apr 25th 2018, 19:19 |
madrid988 |
I have a json request with a datetime as a payload value. How do I get my Cake controller to convert the date string received in the request to a model field frozen date or a format which will save to the database without giving an 'invalid value' error? The field in my postgre db is a timestamp without timezone. |
# |
Apr 25th 2018, 19:04 |
itmpls |
huh? |
# |
Apr 25th 2018, 18:52 |
dwms |
@itmpls no contain? |
# |
Apr 25th 2018, 18:34 |
itmpls |
ha i actually have the same request |
# |
Apr 25th 2018, 18:33 |
dwms |
Hi, how to implement refreshtoken with admad/cakephp-jwt-auth |
# |
Apr 25th 2018, 18:14 |
itmpls |
tried to google it |
# |
Apr 25th 2018, 18:14 |
itmpls |
is getTableLocator() the replacement for get() now in TableRegistry? |
# |
Apr 25th 2018, 17:11 |
dereuromark |
See https://github.com/FriendsOfCake/awesome-cakephp#demo => https://sandbox.dereuromark.de/sandbox/ajax-examples |