[TYPO3-mvc] RealURL with extBase
Nathan Lenz
typo3 at k9tfk.com
Wed Jan 20 19:32:43 CET 2010
Has anyone done this yet? I just read through the "Routing" chapter in
the FLOW3 manual, seems very powerful.
I wonder if it will be possible to make pretty url's with extBase in v4?
I know this might end up involving questions about RealURL, but thought
it might be more appropriate to post it here for now.
-------------------------------------------------
It would be super easy to do something like this with RealURL:
/pageintypo3wheremypluginis/controller/blog/action/show/blogname/my-blog-name/
controller would map to tx_myext_pi1[controller] with a valueMap or
userfunction that makes the controller name all lowercase. I suppose you
could make it work either way by doing:
'blog' => 'Blog',
'post' => 'Post',
'Blog' => 'Blog,
'Post' => 'Post'
action would map to tx_myext_pi1[action] with no special changes because
actions are lower case by default.
Then blogname would map to tx_myext_pi1[Blog] with a table lookup.
I'm not really satisfied with this solution because a url for my domain
would end up being:
/recipes/controller/recipe/action/show/recipe/meatballs-with-gravy/
That's ugly and too long! :) /recipe/ shows up more than once and
/controller/action/ shouldn't be necessary.
In a perfect world, I'd have pretty urls like this:
/recipes/show/meatballs-with-gravy/
/recipes/dishes/main-course/
/recipes/dishes/
-------------------------------------------------
It is easy to extract controller and action from the URL using
fixedPostVars where you make the first parameter the controller and the
second parameter the action for a fixed page id.
However, the third parameter is where it gets complicated. As far as I
know it's not possible to vary a look-up-table based on the second rule
back in the rule chain. So that's where I'm currently stuck.
/somepage/controller/action/uniquestring/string-mapped-to-id-in-table
/somepage/blog/show/blogname/some-blog/
It's still a little ugly in my domain:
/recipes/recipe/show/recipe-name/meatballs-with-gravy
Anyone else given this much thought? What are you doing in your extensions?
--Nathan
More information about the TYPO3-project-typo3v4mvc
mailing list