enhancement
avatar mbabker
mbabker
3 Jan 2013

So, the ugly beast in the room is how to handle routing. Right now, things work just fine with the ugly default URL system. The question is what do we want to do, and what system do we use to do it. If we want SE&HF (Search Engine & Human Friendly) URLs, we're going to have to create a routing instance. We can either use JRouter or try out JApplicationWebRouter (which, TBH, I don't quite understand, but it's in the version of the Platform Pull Tester Louis was working on at https://github.com/LouisLandry/tester).

Ideas are welcome. As well as router system experts.

avatar mbabker mbabker - open - 3 Jan 2013
avatar mbabker mbabker - open - 3 Jan 2013
avatar Hackwar
Hackwar - comment - 4 Jan 2013

If you are interested, I could write a router based on JRouter.

avatar mbabker
mbabker - comment - 4 Jan 2013

I'd greatly appreciate it. Me and the routing code are anything but friends.

avatar elkuku
elkuku - comment - 4 Jan 2013

Yes please :)

avatar dongilbert
dongilbert - comment - 4 Jan 2013

@mbabker In @pasamio's JWC platform app, he shows how to use JApplicationWebRouterRest via a services.json file that mapped routes to a controller suffix. Might be worth taking a look at that.

{
    "tasks" : "tasksList",
    "tasks/:task_id" : "tasks"
}

In that example, :task_id became a param available via $app->input->get->getInt('task_id'); for use within the DemoServicesControllerTasks::execute() method.

avatar Hackwar
Hackwar - comment - 5 Jan 2013

Here would be a proposal based on a slightly changed JRouter: https://github.com/Hackwar/jissues/tree/routing

If possible, I'd like to chat with someone (or several people) about this, so if you have some time, catch me on skype or on IRC on freenode#joomlaportal.de

avatar mbabker
mbabker - comment - 5 Jan 2013

My favorite not accepted change to the routing system :wink:

I do have one request. Can you place your modified versions of JRoute and JRouter in the libraries/tracker tree? I'm trying to keep the cms, joomla, and legacy trees as pure to their upstream sources as possible and with the autoloader priorities, everything is loading from the tracker tree first, allowing for clean class overrides.

avatar Hackwar
Hackwar - comment - 6 Jan 2013

Ok, I moved the files around.

I implemented the possibility for component specific routers, but otherwise it maps the component onto a static phrase like "issues" for com_tracker. If nothing else is given, it directs to the list view of that component. If you give an ID as the next segment, it directs to the item view with the respective ID. Last but not least, if you add a last segment, it tries to hand that over as a task variable. We could change that though.

Give me some feedback and I'll adapt it accordingly.

avatar mbabker
mbabker - comment - 23 Jul 2013

This is long superseded by moving to the Framework based code.

avatar mbabker mbabker - close - 23 Jul 2013
avatar - close - 23 Jul 2013

Add a Comment

Login with GitHub to post a comment