# |
Jul 3rd 2017, 08:18 |
birdy247 |
:slightly_smiling_face: |
# |
Jul 3rd 2017, 08:17 |
savant |
sure |
# |
Jul 3rd 2017, 08:16 |
birdy247 |
It works but is it advisable? |
# |
Jul 3rd 2017, 08:15 |
savant |
sure |
# |
Jul 3rd 2017, 08:14 |
birdy247 |
Session?? |
# |
Jul 3rd 2017, 08:14 |
birdy247 |
If its on a per user basis, it would be in the DB somewhere |
# |
Jul 3rd 2017, 08:13 |
savant |
`$GLOBALS`? |
# |
Jul 3rd 2017, 08:13 |
birdy247 |
Thats the bit I cant get my head around |
# |
Jul 3rd 2017, 08:12 |
savant |
you’re probably going to want to set the SOURCE and TARGET some other way |
# |
Jul 3rd 2017, 08:12 |
birdy247 |
presumably I would have to do this somewhere else in the app? |
# |
Jul 3rd 2017, 08:12 |
birdy247 |
What If I let every user specify their timezone |
# |
Jul 3rd 2017, 08:11 |
savant |
just whenever it maps to the incoming data |
# |
Jul 3rd 2017, 08:11 |
birdy247 |
So does this always assuem that every user is inputting in the same timezone? |
# |
Jul 3rd 2017, 08:11 |
birdy247 |
But this works on contstants |
# |
Jul 3rd 2017, 08:10 |
birdy247 |
to use the date_default_timezone_set |
# |
Jul 3rd 2017, 08:10 |
birdy247 |
I have modified it |
# |
Jul 3rd 2017, 08:09 |
savant |
sure |
# |
Jul 3rd 2017, 08:09 |
birdy247 |
https://github.com/davidyell/TimezoneAwareDateTime/blob/master/src/Database/Type/TimezoneAwareDateTime.php |
# |
Jul 3rd 2017, 08:08 |
birdy247 |
Is this still the "best" method in cake |
# |
Jul 3rd 2017, 08:08 |
birdy247 |
data type** |
# |
Jul 3rd 2017, 08:08 |
birdy247 |
I am using a custom datetype to help deal with datetime inputs |
# |
Jul 3rd 2017, 07:55 |
savant |
https://book.cakephp.org/3.0/en/controllers/components.html#creating-a-component |
# |
Jul 3rd 2017, 07:55 |
savant |
initialize |
# |
Jul 3rd 2017, 07:55 |
pidlo |
where i in comp. class get this parameters? in constructor or in initialize? |
# |
Jul 3rd 2017, 07:54 |
pidlo |
i rewrite old component 2x version.. i have in controller ..... $this->loadComponent('Wsearch', ['model'=>$this->name,...]) |
# |
Jul 3rd 2017, 07:44 |
savant |
Yes |
# |
Jul 3rd 2017, 07:44 |
birdy247 |
@savant you want me to use the actual class anmes? |
# |
Jul 3rd 2017, 07:42 |
birdy247 |
class* |
# |
Jul 3rd 2017, 07:42 |
savant |
use actual class and method names |
# |
Jul 3rd 2017, 07:42 |
birdy247 |
assuming call A is abstract |
# |
Jul 3rd 2017, 07:42 |
birdy247 |
class A calls a method in class B |
# |
Jul 3rd 2017, 07:42 |
savant |
whats the example? |
# |
Jul 3rd 2017, 07:42 |
birdy247 |
I class B extends class A |
# |
Jul 3rd 2017, 07:42 |
birdy247 |
Is it "bad" for a prent class to call a child class method? |
# |
Jul 3rd 2017, 07:31 |
pidlo |
i would like use best practices for this because i cannot rewrite this thinks next 3 years.. |
# |
Jul 3rd 2017, 07:31 |
savant |
yep |
# |
Jul 3rd 2017, 07:31 |
pidlo |
ok savant many thanks, this is ok i revrite cakephp apps writen in versions1.2, 1.3, and 2.x to v 3 |
# |
Jul 3rd 2017, 07:21 |
savant |
require __DIR__ . ‘/functions.php’; |
# |
Jul 3rd 2017, 07:21 |
savant |
then add the following to your config/bootstrap.php |
# |
Jul 3rd 2017, 07:20 |
savant |
just create that file |
# |
Jul 3rd 2017, 07:20 |
savant |
you can put stuff like that in the config/functions.php file |