Welcome Guest, Not a member yet? Register   Sign In
routing problem
#1

[eluser]davidino86[/eluser]
hi everybody,

i can't understand why my routing rule doesn't work...

this is my route.php

Code:
$route['default_controller'] = "home";
$route['scaffolding_trigger'] = "sthp";


$route['prodotti_biliardi/([a-z0-9]+)/([a-z0-9]+)'] = "prodotti_biliardi/show_products/$1";



//URI like '/en/about' -> use controller 'about'<---------------------------------- START MULTILANGUAGE ROUTE
$route['^it/(.+)$'] = "$1";
$route['^en/(.+)$'] = "$1";

// '/en' and '/fr' URIs -> use default controller
$route['^it$'] = $route['default_controller'];
$route['^en$'] = $route['default_controller'];

then my class "prodotti_biliardi"

Code:
&lt;?php
Class Prodotti_biliardi extends Home
{


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

        //---&gt; library
        $this->load->library('pagination');
        //---&gt; model
        $this->load->model('categories_model');
        $this->load->model('products_model');

    }

    function index()
    {
      //no actions
    }
    
    function show_products($id)
    {
        //menu funciton from home controller class
        $this->menu_struct();


        $config['base_url'] = base_url().$this->lang->lang().'/prodotti_biliardi/';

        

        $config['total_rows'] = '200';
        $config['per_page'] = '20';

        //$this->pagination->initialize($config);
        //echo $this->pagination->create_links();
        $data['query'] = $this->products_model->get_category_products($id);

        $this->template->parse_view('content', 'inc/show_products_view', $data);
        $this->template->render();
    }


}
?&gt;

i'd like that when there is a URL like this
Code:
http://www.mydomain.ltd/en/prodotti_biliardi/C9F19FD7-3302-4289-A50B-C13CB43219F5/Biliardi Vip
my application routes on
Code:
prodotti_biliardi/show_pruducts/C9F19FD7-3302-4289-A50B-C13CB43219F5
#2

[eluser]davidino86[/eluser]
in the reg. Ex. i had also used:
Code:
(.*)
:any
([\\w]*)
and tryed with
Code:
^en/prodotti_biliardi/([a-z0-9]+)/([a-z0-9]+)

^it/prodotti_biliardi/([a-z0-9]+)/([a-z0-9]+)




Theme © iAndrew 2016 - Forum software by © MyBB