DooPHP IRC channel


Fully parametric routing

This is for general DooPHP discussion. Ask your questions here.

Fully parametric routing

Postby Michelangelo » Sat Sep 18, 2010 10:57 am

Hi everyone!

i'm looking for a solution to achive this goal:

$route['*']['/:param 1/:param 2'] = array('testController', 'home');

i need to build a fully dynamic route with no static parts, i need this to have fully seo-friendly urls

for sure it wil be easy form me to modify the doourirouter.php code, but it's defenitly the uggliest thing to do IMHO

thanks 4 the answers !
Michelangelo
 
Posts: 9
Joined: Sat Sep 18, 2010 10:42 am

Re: Fully parametric routing

Postby RichardM » Sat Sep 18, 2010 11:29 am

Hi,

Its already supported. See information in my reference guide:
viewtopic.php?f=31&t=1301#p5505

This will resolve the issue of needing a static param as the first item of the url as it allows the first param to become variable. You might also want to try catchall as well which is also covered in the posts.


Richard
Note: code samples my not be 100% accurate.
RichardM
 
Posts: 1329
Joined: Sun Aug 30, 2009 6:03 pm
Location: Cumbria, UK

Re: Fully parametric routing

Postby Michelangelo » Sat Sep 18, 2010 11:31 am

thanks a lot Richard!
I really appreciate your help !

have a nice w.e. !
Michelangelo
 
Posts: 9
Joined: Sat Sep 18, 2010 10:42 am

Re: Fully parametric routing

Postby Michelangelo » Sat Sep 18, 2010 1:38 pm

I'm sorry to bother you again but, I've tryed the solution mentioned in the post you linked me (catchall and root thing)

i.e. :
$route['*']['root']['/:page/wide-screen'] = array('mycontroller', 'mymethod');

but i keep getting the /error page...

I tryed with autoroute true and false, but nothing changes...

I haven't seen anything in the core code about these routing tecniques (i've downloaded the latest version of doophp , 1.2)
do i have to install a plug in ???

thanks again !
Michelangelo
 
Posts: 9
Joined: Sat Sep 18, 2010 10:42 am

Re: Fully parametric routing

Postby RichardM » Sat Sep 18, 2010 2:02 pm

Hi,

You need to get the code from SVN for these things...the downloadable copy (compressed) is rather old and does not support this functionality.

Get it from: http://code.google.com/p/doophp/source/checkout

Note: You'll need to use an svn client to check it out (recommended) or export it


Richard
Note: code samples my not be 100% accurate.
RichardM
 
Posts: 1329
Joined: Sun Aug 30, 2009 6:03 pm
Location: Cumbria, UK

Re: Fully parametric routing

Postby roman » Sat Sep 18, 2010 6:24 pm

This brings up a question of releasing a new version. What's the reason for the delay? Is there a road map for 1.3?
roman
 
Posts: 442
Joined: Sat Aug 01, 2009 8:31 pm

Re: Fully parametric routing

Postby RichardM » Sat Sep 18, 2010 6:48 pm

I've sent Leng a message earlier today...hoping to hear back from him soon.
Note: code samples my not be 100% accurate.
RichardM
 
Posts: 1329
Joined: Sun Aug 30, 2009 6:03 pm
Location: Cumbria, UK

Re: Fully parametric routing

Postby Michelangelo » Sat Sep 18, 2010 6:51 pm

waiting for the 1.3 version, i've update my old DooUriRouter with the new one, it works flawless !
thanks a lot !! keep pushing hard , you're doing a great job !!!
Michelangelo
 
Posts: 9
Joined: Sat Sep 18, 2010 10:42 am

Re: Fully parametric routing

Postby RichardM » Mon Sep 20, 2010 8:00 am

You are best off updating the whole of your framework to run from the latest revision in svn...if you only replaced the one file...
Note: code samples my not be 100% accurate.
RichardM
 
Posts: 1329
Joined: Sun Aug 30, 2009 6:03 pm
Location: Cumbria, UK


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest