# |
May 25th 2017, 18:07 |
cake-novice |
if (isset($forms) andand !empty($forms)) is my check and i want to show different view if result is empty |
# |
May 25th 2017, 18:07 |
cake-novice |
yes i did and also checked... |
# |
May 25th 2017, 18:06 |
jeremyharris |
depends on what your definition of empty is in this case |
# |
May 25th 2017, 18:06 |
jeremyharris |
now, that’s different from “empty” |
# |
May 25th 2017, 18:05 |
jeremyharris |
cake-novice use `isset()` to see if the variable was set on the view |
# |
May 25th 2017, 18:04 |
cake-novice |
Hi, after this in controller $this->set(compact('form')); how we can check in view template that $forms is empty or not? |
# |
May 25th 2017, 17:43 |
deco |
jeremyharris, thanks. |
# |
May 25th 2017, 17:43 |
jeremyharris |
e.g. `$this->Tasks->load('TaskName'. ['var' => true]);` |
# |
May 25th 2017, 17:42 |
jeremyharris |
deco I would recommend passing required variables to the task, rather than the other way around (as the task might be used by other shells which may or may not have that variable) |
# |
May 25th 2017, 17:39 |
deco |
Hi guys! How can I access a Shell variable from a Task? |
# |
May 25th 2017, 17:36 |
steinkel |
bin your controller, I'll take a look |
# |
May 25th 2017, 17:07 |
igreat |
Can't even access the plugin registration page |
# |
May 25th 2017, 17:04 |
igreat |
@steinkel I still encounter the, even after allowing the register action in beforeFilter |
# |
May 25th 2017, 17:03 |
megan |
Hey guys :slightly_smiling_face: who's up for joining the stream? $99 for two days of training, and you can send your questions through via slack/email and we will pass it on https://twitter.com/cakephp/status/867642289669251072 |
# |
May 25th 2017, 16:44 |
gustavocp |
i read more here and i understand |
# |
May 25th 2017, 16:43 |
gustavocp |
thank you for explanation @steinkel :-) |
# |
May 25th 2017, 16:42 |
steinkel |
cake supports ids as int autonumeric and uuid's by default |
# |
May 25th 2017, 16:41 |
steinkel |
hey @gustavocp we are using uuid's for a number of reasons, for example you cannot guess the id of another user |
# |
May 25th 2017, 16:40 |
gustavocp |
anyone can explain why cakeDC/users plugin are using char as primary key? I think that pattern is int(xx) with auto_increment for id entity in cakePHP. https://image.prntscr.com/image/ef309a52cdf74146b030a8a705d274cf.png |
# |
May 25th 2017, 16:16 |
igreat |
Ok |
# |
May 25th 2017, 16:15 |
steinkel |
so users can access that action without login first |
# |
May 25th 2017, 16:15 |
steinkel |
you want to set your new register action as public |
# |
May 25th 2017, 16:14 |
steinkel |
@igreat I think your issue is related with > https://book.cakephp.org/3.0/en/controllers/components/authentication.html#making-actions-public |
# |
May 25th 2017, 16:13 |
igreat |
Already followed that, but same issue |
# |
May 25th 2017, 16:10 |
steinkel |
please follow the documented instructions here > https://github.com/CakeDC/users/blob/master/Docs/Documentation/Extending-the-Plugin.md#extending-the-controller |
# |
May 25th 2017, 16:09 |
igreat |
thought it would inherit it from the Users controller |
# |
May 25th 2017, 16:09 |
igreat |
Nope, but I have this in the controller `namespace App\Controller; use CakeDC\Users\Controller\UsersController; class MyUsersController extends UsersController` |
# |
May 25th 2017, 16:08 |
spriz |
any way to make the cake bake output relations like so: https://gist.github.com/Spriz/46a7f27c56548068b2e57627a2cf9d28 ? |
# |
May 25th 2017, 16:08 |
steinkel |
usually in beforeFilter callback |
# |
May 25th 2017, 16:08 |
steinkel |
yes, to specify this action does not require a logged in user |
# |
May 25th 2017, 16:07 |
igreat |
U mean in my controller? |
# |
May 25th 2017, 16:06 |
steinkel |
did you allow the register action using $this->Auth->allow()? |
# |
May 25th 2017, 16:06 |
igreat |
Only the login page loads and other pages says "You are not authorized to access that location." |
# |
May 25th 2017, 16:05 |
igreat |
Now when I navigate to `/my-users/register` it returns "You are not authorized to access that location." |
# |
May 25th 2017, 16:04 |
igreat |
I installed CakeDC Users plugin, then tried to extend it with another controller. |
# |
May 25th 2017, 15:53 |
jeremyharris |
been there |
# |
May 25th 2017, 15:53 |
jeremyharris |
:) |
# |
May 25th 2017, 15:51 |
night_wulfe |
So I'm banging my head against the wall trying to figure out what Timestamp setting or bug I have in my custom behavior that would cause CakePHP to default my 'created' field to two days ago at noon. Then I find this line of debugging code I had left in my controller two days ago :| ``` $organization['created'] = '2017-05-23 12:00:00 PM';``` |
# |
May 25th 2017, 15:46 |
birdy247 |
Then lets get 1 up on laravell :+1: |
# |
May 25th 2017, 15:40 |
dakota |
> new joiner (who was a laravell user) has made the same mistake @birdy247 Laravel has the same problem :slightly_smiling_face: |
# |
May 25th 2017, 15:40 |
jeremyharris |
yeah I can’t find one in the docs |