21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 268 Views |
-
Director::addRules [SOLVED]

2 August 2012 at 11:49pm Last edited: 2 August 2012 11:51pm
HI
I need to simulate several urls.Pages:
1. categories
a. subCategoryA
b. subCategoryB2. products
a. productTypA
- product1
- product2
b. productTypB
- product 3I try to simulate a url like this:
categories/subCategoryA/productTypB/product 3I use this Director::Rule to handle my requests:
Director::addRules(100, array(
'categories//$subCategory!/$productTyp' => 'Hauptkategorie_Controller'
));and this handler (read the comments):
public static $url_handlers = array(
'' => 'index',
//works ->URL:http://website.xx/categories'$subCategory' => 'subCategory',
//works ->URL:http://website.xx/categories/subCategory'$subCategory/$productTyp' => 'test'
// does not work. I'm getting a 404 ->URL:http://website.xx/categories/subCategory/productTyp
);I think calling the url http://website.xx/categories/subCategory/productTyp does not match the rule, but I don't understand why.
Any help appreciated
Thanks in advance
Lukin
-
Re: Director::addRules [SOLVED]

3 August 2012 at 7:08pm Last edited: 3 August 2012 7:12pm
This is working ....
Caution! Don't forget the '!'
in my _config
Director::addRules(100, array(
'cateories//$subcategories/$producttyp/$product' => 'Hauptkategorie_Controller'
));in my handler:
public static $url_handlers = array(
'$subcategories/$producttyp/$product!' => 'test4',
'$subcategories/$producttyp!' => 'test3',
'$subcategories!' => 'test2',
'' => 'test1'
);cheers ;)
| 268 Views | ||
|
Page:
1
|
Go to Top |

