Welcome Guest, Not a member yet? Register   Sign In
HMVC loading URL helper problem
#1

[eluser]Altazar[/eluser]
I've posted this twice in other threads a few days ago and no one answered. I'm not able to find what is causing problem. I have a fresh installation of latest CodeIgniter. The only modification I've done is adding HMVC and multilingual libraries.

In modules' controllers I have this:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Site extends MX_Controller {

    public function __construct()
        {
        parent::__construct();
        }

    public function index(){
        $this->lang->load('site_language');
        $this->load->view('site_header');
        $this->load->view('site_content');
        $this->load->view('site_footer');
    }
}
In site_header view are little country flags images with links for switching languages:
Code:
$path = 'http://mywebsite.com/images/flags';
echo anchor($this->lang->switch_uri('de'), img($path.'/de.png'));
echo anchor($this->lang->switch_uri('en'), img($path.'/en.png'));
echo anchor($this->lang->switch_uri('fr'), img($path.'/fr.png'));
Flags aren't shown. The same code works in MVC.
I'm autoloading URL helper and have tried loading it from the module's controller.
If I use HTML tags a href= and img src=, everything works fine.
I've also tried creating a flags module, but it does not show flags.
Maybe I should make a function which extends URL helper, I have no other idea.
These are my routes:
Code:
// URI like '/en/about' -> use controller 'about'
$route['^de/(.+)$'] = "$1";
$route['^en/(.+)$'] = "$1";
$route['^fr/(.+)$'] = "$1";

// URI like '/en' -> use default controller
$route['^de$'] = $route['default_controller'];
$route['^en$'] = $route['default_controller'];
$route['^fr$'] = $route['default_controller'];
Could it be causing this problem?
#2

[eluser]Altazar[/eluser]
The problem is solved:
https://github.com/EllisLab/CodeIgniter/...ation-i18n

/*
in case you use it with the HMVC modular extension
uncomment this and remove the other lines
load the MX_Loader class
*/




Theme © iAndrew 2016 - Forum software by © MyBB