autoloading helper library model breake ajax json |
Hy, i am facing a really strange issue when using the autoload.php file.
if i use the $autoload['helper'] = array('myOwnHelper'); inside the config/autoload.php and i make a jquery ajax request, the json isn't render (no object show in console.log ). But with the same ajax and the loading made inside the controller with $this->load->helper('myOwnHelper'); tadam, all worke fine as it must do (the problem is the same whith autoloading my own model). Someone have see this stuff before? I had this behavior since CI2, it's not new. The only manner i have found to bypass this it's to render the request as html, then trim the response ![]() The other solution it's to load at each page helper and model who normally must be globally initialised. Any help would be appreciated it's since days i try to solve this feature ps: i have join an image of what is passing because i am not so sure of my english for the explanation ![]()
no, i don't call get_instance(), here is the code of the helper
PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); and i have the same problem when i try to auto load this model PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
i have try several things, and no way, each time i make an auto loading the json is not interpreted
if i use a construct and put inside the load of helper model library, it make the same behavior if i load them inside the function in the controller it work worst, i am enable to load helper model library inside the ajax controller or it breake the json...i am driving nuts...oblige to make procedural stuff inside the controller this work : PHP Code: <?php this make the json uninterpreted PHP Code: <?php as for the js Code: $.post( exept for this problem of json interpretation all work like a dream, really don't know what i am missing
the url is give by base_url() already, try your solution don't change nothing to my problem, this not empech te json to be not interpretated
i have the same problem which is describe here i solve this problem by not loading the model (or library or helper) which cause the breake of the json format. when you looke at the response given when you use $this->load-> is ÿÿÿÿÿÿ{my json well formated} |
Welcome Guest, Not a member yet? Register Sign In |