Log message #4048020

# At Username Text
# Jul 5th 2017, 11:46 juststeveking I know x) having one of those days
# Jul 5th 2017, 11:45 cleptric No problem at all :slightly_smiling_face: Casting objects is more PHP then CakePHP ^^
# Jul 5th 2017, 11:45 juststeveking I figured it out from other code in the model
# Jul 5th 2017, 11:45 juststeveking Sorry guys, relatively new to cake
# Jul 5th 2017, 11:44 neon1024 gg PHP
# Jul 5th 2017, 11:44 neon1024 Ah yes, it seems you can! https://3v4l.org/9TjST
# Jul 5th 2017, 11:43 neon1024 I wonder what would happen
# Jul 5th 2017, 11:43 neon1024 Can you cast a class to array?
# Jul 5th 2017, 11:43 cleptric `$this` should be the Table when you’re calling your mail stuff in afterSave
# Jul 5th 2017, 11:41 juststeveking Can I cast $this to an array to pass through to my email?
# Jul 5th 2017, 11:40 juststeveking :slightly_smiling_face: thanks dde
# Jul 5th 2017, 11:40 juststeveking `->viewVars()`
# Jul 5th 2017, 11:36 cleptric don‘t remember the exact name right now ,:)
# Jul 5th 2017, 11:36 cleptric And also something for the view vars
# Jul 5th 2017, 11:35 cleptric There is a setTemplate method
# Jul 5th 2017, 11:35 juststeveking I know, I have added it, but wasn't sure how to send through a rendered template with variables
# Jul 5th 2017, 11:35 cleptric The Email class is available everywhere
# Jul 5th 2017, 11:35 juststeveking I am used to swiftmailer
# Jul 5th 2017, 11:34 juststeveking So how do I best pass through an email view to the CakeEmail class?
# Jul 5th 2017, 11:34 juststeveking Ah ok :slightly_smiling_face:
# Jul 5th 2017, 11:34 cleptric Components are tied to the Controller layer
# Jul 5th 2017, 11:33 juststeveking But the people who built the application made a communication component
# Jul 5th 2017, 11:33 juststeveking On my afterSave method I want to send an email :slightly_smiling_face:
# Jul 5th 2017, 11:33 cleptric No, this doesn’t make sense though. Want do you want to do?
# Jul 5th 2017, 11:32 juststeveking Is there a way I can add components to a model at all?
# Jul 5th 2017, 11:16 chris-andre @neon1024 Date and time is and has always been my worst nightmare :P
# Jul 5th 2017, 11:12 unclezoot ?redirect= only appears if i try to access a simple one word page e.g. /myaccount, but try logging into a page with parameters. e.g. /resources/assets/view/1 and ?redirect= has completely disappeared
# Jul 5th 2017, 11:09 juststeveking @savant thanks for that! I think it may be a little worthless adding this in on a dispatch filter, as the speed will be no different in adding to my audit table than it is adding to a queue table
# Jul 5th 2017, 11:06 unclezoot hmm, ?redirect= doesnt always appear when you get the 'you are not authorized to access that location' message?
# Jul 5th 2017, 11:03 unclezoot i dont have any redirects configured in my Auth component, but i can see the query string now im killing my code in the right place. will just redirect to that. thanks neon!
# Jul 5th 2017, 11:01 unclezoot yes i see the qs, but couldnt see where it went after logging in
# Jul 5th 2017, 10:59 neon1024 You should even notice that when you are on the login url, that there is a query string which contains the previous url
# Jul 5th 2017, 10:58 neon1024 https://book.cakephp.org/3.0/en/controllers/components/authentication.html#redirecting-users-after-login
# Jul 5th 2017, 10:58 neon1024 This is part of the AuthComponent by default, unless the configuration is overridden when configuring the Auth Component.
# Jul 5th 2017, 10:56 unclezoot Is this functionality already built into the auth component that I've missed, or do I need to write this code myself?
# Jul 5th 2017, 10:56 unclezoot hi folks, when I'm clicking a link when not logged in, I get sent to my login page but afterwards, the homepage (/). I'd like the user to get redirected to the link they actually clicked once logged in.
# Jul 5th 2017, 10:54 neon1024 Working with time and dates hurts my brain!
# Jul 5th 2017, 10:54 neon1024 My tests pass :)
# Jul 5th 2017, 10:54 neon1024 Right, thanks everyone. The logic in that link was sound thanks @savant, it also turns out that you’re spot on @chris-andre with getting the seconds as a float of hours by `$seconds / 60 / 60`
# Jul 5th 2017, 10:22 neon1024 Your Google-Fu is strong!
# Jul 5th 2017, 10:22 savant searched for “decimal time php” on google :slightly_smiling_face: