I have a site with large and dynamically change contents tree, but with only several page types for tree items. I need to process and render every item by corresponding controller and template, which defined by "pagetype" field into DB record for this item. So, I think that the best way to create routes is something like this:
$r->bridge->to(cb => sub{
$self = shift;
$pagetype = get_pagetype_from_db( $self->tx->req->url->path->to_string );
return "$pagetype#process"
})->route->to;
where $pagetype is controller name.
In my first question, I asked how can I use stash for the change of dispatch.
But, if I can't use it, maybe there is some other simple way to do this?
I do not want to create my self router because of Mojo has it. I think, that there must be a little hack or hook for this :)
понедельник, 18 марта 2013 г., 22:07:31 UTC+2 пользователь John Berthels написал: