# |
Jul 3rd 2019, 08:33 |
neon1024 |
That’s a validation rule |
# |
Jul 3rd 2019, 08:33 |
ra7bi |
@neon1024 how i can set a rule to check associated data if exist ? for example when adding User records , User must insert a photo or many photos , im talking about Users/add As i know i can set a rule to check if users table field are set or not , but not photos which is belong to users |
# |
Jul 3rd 2019, 08:18 |
neon1024 |
@ra7bi You’re looking for a hasMany association, with a rule and validation |
# |
Jul 3rd 2019, 08:17 |
neon1024 |
@ra7bi Yes it does |
# |
Jul 3rd 2019, 08:17 |
neon1024 |
How’d you update existing row data with a migration? Does that require sql? |
# |
Jul 3rd 2019, 08:14 |
scuadra |
Hello. In Cake 3.7 for some reason the TimestampBehavior is not working for me. I do not have modified field in my table but only created. Could this be the issue? |
# |
Jul 3rd 2019, 07:50 |
ra7bi |
im talking about Insert `User.photo` |
# |
Jul 3rd 2019, 07:48 |
ra7bi |
do cakephp support this type of relation `User at least have one Photo or more but not null ` FYI Photo is another table |
# |
Jul 3rd 2019, 07:47 |
ra7bi |
Hey |
# |
Jul 3rd 2019, 07:24 |
challgren |
@drailanjohn.gss DebugKit will help you with that |
# |
Jul 3rd 2019, 05:56 |
drailanjohn.gss |
hello guys, how can I measure the speed of a query in cake php ? |
# |
Jul 3rd 2019, 05:44 |
xuanvu442 |
Hello guys, I’ve a small question, please help me. Can I see the log request from the user? something like this |
# |
Jul 3rd 2019, 00:24 |
waspinator |
for example with the current authorized user `$this->Identity->get('id')` |
# |
Jul 3rd 2019, 00:23 |
waspinator |
is there a way to set the id crud view action if its not provided? https://crud.readthedocs.io/en/latest/actions/view.html |
# |
Jul 2nd 2019, 22:12 |
joey.mukherjee |
I don't have a method for profile in my UsersController. If I add one, it doesn't get called. However, I have `<?php echo $this->User->link ("My Profile", ['plugin' => 'CakeDC/Users', 'controller' => 'Users', 'action' => 'profile'], ['class' => 'dropdown-item']); ?>` as my link. If I change plugin to false, I get CakeDC/Users.ProfileController not found. Am I not extending correctly? |
# |
Jul 2nd 2019, 22:01 |
ricksaccous |
extend the controller... then expose the variables you want in your extended controller |
# |
Jul 2nd 2019, 21:58 |
slackebot |
wrong... |
# |
Jul 2nd 2019, 21:58 |
joey.mukherjee |
I've got another dumb question about the CakeDC Users plugin. I know how to customize the profile page as I copy it from the Template area under CakeDC to my own. However, I want to update the information that goes in there. In other words, I want to send my own related tables to the profile page. What is the best way to do that? Right now, I am editing vendor/cakedc/users/src/Controller/Traits/ProfileTrait.php. I know that is |
# |
Jul 2nd 2019, 20:44 |
joey.mukherjee |
Thanks, that worked! I had `$this->loadHelper ('CakeDC/Users.User');` in there but I guess I need the AuthLink as well. Are there others that I should be aware of? |
# |
Jul 2nd 2019, 20:29 |
rochasmarcelo |
load it inside your AppView ```public function initialize() { $this->loadHelper('CakeDC/Users.AuthLink'); ```` |
# |
Jul 2nd 2019, 20:24 |
joey.mukherjee |
I don't have this everywhere apparently. I am getting a Missing Helper error. For me to have this in my baked views, I am adding this to the top: `use CakeDC\Users\View\Helper\AuthLinkHelper;`. but it doesn't work. What is the right namespace? |
# |
Jul 2nd 2019, 20:04 |
rochasmarcelo |
https://github.com/CakeDC/users/blob/master/src/View/Helper/AuthLinkHelper.php |
# |
Jul 2nd 2019, 20:03 |
joey.mukherjee |
Thanks @rochasmarcelo, that worked... I have never seen AuthLink. Where is that? |
# |
Jul 2nd 2019, 20:03 |
ricksaccous |
oh cool, is that a thing? interesting |
# |
Jul 2nd 2019, 20:01 |
rochasmarcelo |
like ``` $this->AuthLink->isAuthorized($url)``` |
# |
Jul 2nd 2019, 20:01 |
rochasmarcelo |
or AuthLink::isAuthorized |
# |
Jul 2nd 2019, 20:00 |
rochasmarcelo |
AuthLink::link |
# |
Jul 2nd 2019, 20:00 |
rochasmarcelo |
@joey check AuthLink |
# |
Jul 2nd 2019, 19:57 |
ricksaccous |
no, you can create your own helper though |
# |
Jul 2nd 2019, 19:56 |
joey.mukherjee |
So I need booleans for every little thing? That seems wrong to me. I think I am using the Rbac so it seems like there should be an easier way, but looking at the docs, it mentions identity traits and all that and I don't think I have any of that? |
# |
Jul 2nd 2019, 19:55 |
ricksaccous |
and pass it down to the view |
# |
Jul 2nd 2019, 19:55 |
ricksaccous |
you can set a canEdit boolean in the controller |
# |
Jul 2nd 2019, 19:54 |
ricksaccous |
it doesn't come with a helper |
# |
Jul 2nd 2019, 19:54 |
ricksaccous |
@joey.mukherjee indeed, that's a component not a helper |
# |
Jul 2nd 2019, 19:52 |
joey.mukherjee |
Hello all! I am using the CakeDC Users plugin. In my view, what is the correct/best way to show (or not) a link if the user is allowed to do what the link points to or not? I have this: `if ($this->Authorization->can ($role, 'edit'))` but it says I am missing the Authorization helper. |
# |
Jul 2nd 2019, 17:29 |
ricksaccous |
https://cakesf.slack.com/archives/C053DPNGT/p1562080052460900 |
# |
Jul 2nd 2019, 17:29 |
ricksaccous |
@olanowsubomi that was already explained to you |
# |
Jul 2nd 2019, 17:24 |
olanowsubomi |
it brought ' microsoft javasript runtime error ! |
# |
Jul 2nd 2019, 17:21 |
olanowsubomi |
i was able to open my downloaded bootstrap .css files alone. why? |
# |
Jul 2nd 2019, 17:19 |
olanowsubomi |
please, can someone not open file stored as .js on windows |
# |
Jul 2nd 2019, 17:12 |
ricksaccous |
it actually wasn't allowed via authentication and i thought it was |