[development] The new menu system

Bèr Kessels ber at webschuur.com
Wed Sep 27 09:07:03 UTC 2006


Op woensdag 27 september 2006 09:21, schreef Dries Buytaert:
> On 26 Sep 2006, at 20:01, Bèr Kessels wrote:
> > I really suggest again to have a look at ruby on rails routers.
> > They do all
> > you say, people have thought about it very well,  they have proved
> > to be
> > working extremely well, without any performance issues.
> > It will also allow us a few steps closer to MVC, without inventing
> > too much
> > wheels ourselves.
> >
> > Words to look for: Routers, Model and Controller.
>
> I tried searching for these but couldn't come up with a satisfying
> explanation of RoR's routers.

This is a hands-on tutorial on how to /use/ them: 
http://manuals.rubyonrails.com/read/chapter/65

When reading that, it roughly translates to Drupal as folloows: 
 Ruby ':year/:month/:day', :controller => 'blog', :action => 'by_date'
 Druphp : array('#path' => '%year/%month/%day', '#module' 
=> 'blog', '#callback' => blog_by_date)

%year/%month/%day will be available in blog_by_date() as $year, $month, $day, 
or as array('year' => 2006, 'month' => xyz, etc ).

If you have some more time, dive into the large docs. 
http://wiki.rubyonrails.org/rails/pages/routes
You will see that routers in RoR go really wild and funky at some point by 
allowing regexps etc. I think we should focus on the basis, the concept. 

> I did, however, found http://framework.zend.com/issues/browse/
> ZF-166.  It demonstrates a PHP implementation of RoR's router conecpt
> (as implemented in the Zenf framework).

Interesting. Esp since the amout of code is quite small (yet too complex for 
me to understand :-) )  I am not particularly fond of the :notation, since 
that is a native Ruby concept (sort of like the Globals in PHP), but here 
ported to PHP. I think we should try to keep it more native PHP :-)

Bèr
-- 
| Bèr Kessels | webschuur.com | Drupal, Joomla and Ruby on Rails web 
development |
| Jabber & Google Talk: ber at jabber.webschuur.com |
| http://bler.webschuur.com | http://www.webschuur.com |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/development/attachments/20060927/110255fb/attachment.pgp


More information about the development mailing list