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.
I'd greatly appreciate it. Me and the routing code are anything but friends.
Yes please :)
@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.
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
My favorite not accepted change to the routing system
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.
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.
This is long superseded by moving to the Framework based code.
If you are interested, I could write a router based on JRouter.