Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - HMVC version 5.2
#31

[eluser]phpwebdev[/eluser]
[quote author="wiredesignz" date="1213420738"]@phpwebdev, You can load a module language file by using: $this->load->language('filename', 'langauge') as described in CI user guide.

Example:
Code:
//modules/{current_module}/language/spanish/spanish_lang.php
$this->load->language('spanish', 'spanish');
[/quote]

Thanks
All clear now , work fine

Regards
Valko Valkov

PS I already in love with ME
#32

[eluser]Milos Dakic[/eluser]
If my structure was:

Code:
-application
   -views
       -default
          -projects
               -projects.php

would I be able to use this

Code:
$this->load->view('default/projects',$data)

?
#33

[eluser]wiredesignz[/eluser]
Code:
$this->load->view('default/projects/projects',$data);
#34

[eluser]wiredesignz[/eluser]
Modular Extensions PHP5 is at revision 5.0.19

Please message me privately with your email address if you would like to join the test group.
#35

[eluser]Sam Dark[/eluser]
Still can't load config from a module Sad

Also can't do this from a model anymore:
Code:
$this->load->library('email');
$this->email->initialize(array());
#36

[eluser]wiredesignz[/eluser]
@Sam, as I explained earlier, try using $this->config->load();

Since ME5021 you may method chain, so try: $this->load->library('email')->initialize(array());
#37

[eluser]Sam Dark[/eluser]
Tried what you've suggested for config and it failed. Applied my fix again Sad

Tried within a model:

Code:
$this->load->library('email')->initialize(array('useragent' => 'Mailer', 'mailtype' => 'html', 'wordwrap' => false));

Got Undefined property: Comment::$email.

Comment is a global model, not module model.
#38

[eluser]wiredesignz[/eluser]
@Sam, I have tested $this->config->load('my_file') to load a config file from application/config directory and it does work as normal.

I have sent through a bugfix revision 5.0.23, to restore functionality for loading libraries in model constructor. Thanks Sam. Wink
#39

[eluser]Sam Dark[/eluser]
Loading libraries works again. Thanks!

Checked config loading separately from my structure. Works.

Would you please explain one thing:

I have separate View library that is autoloaded to be accessible as $this->view.

Inside it i'm using get_instance() to get to controller:
Code:
function render($template){
    $CI = &get;_instance();
    $CI->load->config('site', true);
    $site_config = $CI->config->item('site');
    …  
  }

Now I'm trying to use it from a module controller. Everything except config loading works perfect. Config loading works with the patch I've mentioned before.

Am I right that get_instance() returns module controller and not anything else?
#40

[eluser]Sam Dark[/eluser]
Got another one… when using more than one base controller like this:

Code:
class Public_Controller extends Controller {
   function __construct() {
        parent::__construct();
   }
}

class Auth_Controller extends Public_Controller {    
    function __construct() {
        parent::__construct();
    }
}

and then using Auth_Controller as a module base:
Code:
class Util extends Auth_Controller {    
    function __construct() {
        parent::__construct();
    }

    function index(){
      $this->load->view('util/index');
    }
}

I'm getting Unable to locate the requested file: ../app/views/util/index.php.

upd: getting the same even with Controller as a base… strange. This is just for one module.

upd: not a bug, my fault.




Theme © iAndrew 2016 - Forum software by © MyBB