Help me for this library |
I am using HMVC extension with COdeigniter 3 rc3
And also this lib. http://www.grocerycrud.com/codeigniter-simplicity I know this is for old version but its working fine in ci3. My problem is. When I use its default given controllers and view in modules with its working fine. And when i use my own controllers and views its working but css and js file not loaded with it. Its show nothing.. PHP Code: class Test extends MX_Controller { Folder location .. application/ ---modules/ test/ --controllers/ --Test.php --views/ --testview.php -themes/ --test.php themes/test.php PHP Code: This is test's testview.php PHP Code: <hr/> OutputSource is PHP Code: This is test's
The CodeIgniter-simplicity code is overloading the loader to handle assets ($this->load->js()/$this->load->css()). HMVC is also overloading the loader to support HMVC (and the MX_Controller kicks off loading a lot of the other HMVC code).
More than likely, the MX_Loader and codeigniter-simplicity's MY_Loader are not playing nice together, so you would have to modify one or the other to work together. The first thing I would try would be to modify MY_Loader.php to extend MX_Loader instead of CI_Loader.
I forgot to say i already done this.
PHP Code: (defined('BASEPATH')) OR exit('No direct script access allowed'); But still not loading js, meta css file only. Other things running perfactly Please
Please any one help me. Its emergency condition for me..Please. I am stuck on this point. Curruntly I am including it with manually please..
We are also using HMVC extension with COdeigniter 3
Our approach to use js and css files for our project is little bit different. We first define few constants in application/config/constants.php as below $server_name=$_SERVER['HTTP_HOST']; define( 'BASE_URL',"http://".$server_name."/demo/" ); // User directory path define( 'BASE_CSS', BASE_URL . 'media/user/css/' ); define( 'BASE_JS', BASE_URL . 'media/user/js/' ); Then in template header file we use these constants to load js and css files File : application/modules/test/views/themes/test.php <link href="<?php echo BASE_CSS; ?>bootstrap.min.css" rel="stylesheet"> <script type='text/javascript' src='<?php echo BASE_JS; ?>jquery-1.9.1.min.js'></script> I hope this will help you.
No its Not..
Common files already included in my layout.But sometime we need to include specific file for specific page.In that condition we should use this load js function.
(03-13-2015, 09:56 PM)Vimal Wrote: No its Not.. In that case one solution is : add js file path inside the specific function in controller as : $this->data['javascript'][] = BASE_JS. "jquery.validate.min.js"; and then in your header file or footer file use the below code : <?php if(!empty($javascript)) { if(is_array($javascript) && sizeof($javascript) > 0){ foreach($javascript as $k => $v){ echo '<script src="'.$v.'"></script>'; } } } ?> In this way page specific js files will be included. Same logic can be used for css files. I hope now your problem will be solved.
(03-13-2015, 09:56 PM)Vimal Wrote: No its Not.. I had the same problem. A compromise for this problem is extending your controller with CI_Controller instead of MX_Controller . Extending the controllers with MX_Controller seems required only if you want call other controller functions from within a controller . |
Welcome Guest, Not a member yet? Register Sign In |