Welcome Guest, Not a member yet? Register   Sign In
How Safari browser handles CI Hooks
#1

[eluser]Unknown[/eluser]
Hello,

For some reason Safari handles our post_controller_constructor before the actually controller, instead of after, when it's suposed to be handled.

I checked multiple forums, but never came trough a post similiar to this annoying bug.
If someone has an idea why, when, how, or for whatever reason Safari does what it does, please comment.

Opera, IE(6-8), FireFox, Chrome, no problem at all.


Regards,


Roedie
#2

[eluser]danmontgomery[/eluser]
Yikes.

First, PHP is a server-side language, which means the code is executed on the server before it is ever sent to the browser. Safari, Opera, IE, Firefox or Chrome never see a line of PHP code, they only see output.

Second, the post_controller_constructor hook is run after the controller constructor, not after the controller. The constructor is called when the class is initialized, so yes, it will always run before the controller method executes. If you want a hook that executes after the controller, you should use post_controller.
#3

[eluser]Unknown[/eluser]
Lab Technician,

I couldnt agree more, except for the fact that before we posted this message on the forum we tried everything we could think of. I know how PHP and browsers behave, its also very clear to us how CI behaves and what we should do. The fact is, everything works more than fine in every browser, on every computer, except in Safari.

It just turns around the controller/hook:post_controller(_constructor) into hook/controller.
I cant get the CI to work for me in the pre_controller hook, so I need the controller to load first. To recognize the language information from the browser/session/url. Then, the hook does things with that information.

Offcourse we can work around the problem, but its just annoying Safari refuses, while the rest of them accepts out method of work.


Roedie
#4

[eluser]Pascal Kriete[/eluser]
Hey Roedie,

Are you still hung up on this issue?

I have a hard time believing that Safari is the culprit here, but I want to help you get to the bottom of it. Do you have reduced version of your code that you could share with us so we can try to reproduce?




Theme © iAndrew 2016 - Forum software by © MyBB