As a part of my GSoC project, I am working with the new router. I have used
the following map and I was wondering if there is an easier way to do it
(without changing the current parseRoute method
from JApplicationWebRouterBase). I am asking this because I will need such
mappings for all type of contents used in the API.
$this->router->addMap('/content', 'content'); match all the content
with the content controller
$this->router->addMap('/content/*', 'content'); match a specific
content with the content controller
You might get more help if you provide more details about what you're
doing, what you're trying to solve, why in detail this is a problem
and some background on the project. I certainly have no idea what
you're after, why you think changing parseRoute would provide a
solution or what you mean by "easier way to do it".
> As a part of my GSoC project, I am working with the new router. I have used
> the following map and I was wondering if there is an easier way to do it
> (without changing the current parseRoute method
> from JApplicationWebRouterBase). I am asking this because I will need such
> mappings for all type of contents used in the API.
> $this->router->addMap('/content', 'content'); match all the content
> with the content controller
> $this->router->addMap('/content/*', 'content'); match a specific content
> with the content controller
I need to add more rules like the following ones:
$this->router->addMap('/content', 'content');
$this->router->addMap('/content/:content_id', 'content');
$this->router->addMap('/applications', 'applications');
$this->router->addMap('/applications/:application_id', 'applications');
$this->router->addMap('/categories', 'categories');
$this->router->addMap('/categories/:categories_id', 'categories');
I was wondering if there is any way to summarize somehow all these rules in
a single one.
--
Thanks,
Stefan Neculai
Sent from my iPhone
On Jun 19, 2012, at 6:39 AM, Sam Moffatt <pasa...@gmail.com> wrote:
You could create a route file and have parsed to add items or
introspect it from the database to do it that way. Perhaps I'm missing
something here. It's six routes with distinct looking parameters,
seems reasonable enough to have six different mappings.
> I need to add more rules like the following ones:
> $this->router->addMap('/content', 'content');
> $this->router->addMap('/content/:content_id', 'content');
> $this->router->addMap('/applications', 'applications');
> $this->router->addMap('/applications/:application_id', 'applications');
> $this->router->addMap('/categories', 'categories');
> $this->router->addMap('/categories/:categories_id', 'categories');
> I was wondering if there is any way to summarize somehow all these rules in
> a single one.
> --
> Thanks,
> Stefan Neculai
> Sent from my iPhone
> On Jun 19, 2012, at 6:39 AM, Sam Moffatt <pasa...@gmail.com> wrote:
> You could create a route file and have parsed to add items or
> introspect it from the database to do it that way. Perhaps I'm missing
> something here. It's six routes with distinct looking parameters,
> seems reasonable enough to have six different mappings.
> On Tue, Jun 19, 2012 at 12:07 AM, Stefan Neculai
> <stefan.necu...@gmail.com> wrote:
>> Hi,
>> I need to add more rules like the following ones:
>> $this->router->addMap('/content', 'content');
>> $this->router->addMap('/content/:content_id', 'content');
>> $this->router->addMap('/applications', 'applications');
>> $this->router->addMap('/applications/:application_id', 'applications');
>> $this->router->addMap('/categories', 'categories');
>> $this->router->addMap('/categories/:categories_id', 'categories');
>> I was wondering if there is any way to summarize somehow all these rules in
>> a single one.
>> --
>> Thanks,
>> Stefan Neculai
>> Sent from my iPhone
>> On Jun 19, 2012, at 6:39 AM, Sam Moffatt <pasa...@gmail.com> wrote:
They are similar but that doesn't mean they are the same. The new
router aims to solve one of the problems that has consistently dogged
us with the old router which is detangling that which is similar that
appears to be the same but isn't necessarily so. In this paradigm it
is very clear what goes where. This may not necessarily be suitable
for you so you might choose to build your own router that handles
requests in a way that makes more sense for your application.
<stefan.necu...@gmail.com> wrote:
> There are more routes, not only 6 but all are the same. I asked about
> sumarizing them because they are very simillar.
> --
> Stefan
> Sent from my iPhone
> On Jun 19, 2012, at 10:23 AM, Sam Moffatt <pasa...@gmail.com> wrote:
>> You could create a route file and have parsed to add items or
>> introspect it from the database to do it that way. Perhaps I'm missing
>> something here. It's six routes with distinct looking parameters,
>> seems reasonable enough to have six different mappings.
>> On Tue, Jun 19, 2012 at 12:07 AM, Stefan Neculai
>> <stefan.necu...@gmail.com> wrote:
>>> Hi,
>>> I need to add more rules like the following ones:
>>> $this->router->addMap('/content', 'content');
>>> $this->router->addMap('/content/:content_id', 'content');
>>> $this->router->addMap('/applications', 'applications');
>>> $this->router->addMap('/applications/:application_id', 'applications');
>>> $this->router->addMap('/categories', 'categories');
>>> $this->router->addMap('/categories/:categories_id', 'categories');
>>> I was wondering if there is any way to summarize somehow all these rules in
>>> a single one.
>>> --
>>> Thanks,
>>> Stefan Neculai
>>> Sent from my iPhone
>>> On Jun 19, 2012, at 6:39 AM, Sam Moffatt <pasa...@gmail.com> wrote:
> They are similar but that doesn't mean they are the same. The new
> router aims to solve one of the problems that has consistently dogged
> us with the old router which is detangling that which is similar that
> appears to be the same but isn't necessarily so. In this paradigm it
> is very clear what goes where. This may not necessarily be suitable
> for you so you might choose to build your own router that handles
> requests in a way that makes more sense for your application.
> On Tue, Jun 19, 2012 at 12:25 AM, Stefan Neculai
> <stefan.necu...@gmail.com> wrote:
>> There are more routes, not only 6 but all are the same. I asked about
>> sumarizing them because they are very simillar.
>> --
>> Stefan
>> Sent from my iPhone
>> On Jun 19, 2012, at 10:23 AM, Sam Moffatt <pasa...@gmail.com> wrote:
>>> You could create a route file and have parsed to add items or
>>> introspect it from the database to do it that way. Perhaps I'm missing
>>> something here. It's six routes with distinct looking parameters,
>>> seems reasonable enough to have six different mappings.
>>> On Tue, Jun 19, 2012 at 12:07 AM, Stefan Neculai
>>> <stefan.necu...@gmail.com> wrote:
>>>> Hi,
>>>> I need to add more rules like the following ones:
>>>> $this->router->addMap('/content', 'content');
>>>> $this->router->addMap('/content/:content_id', 'content');
>>>> $this->router->addMap('/applications', 'applications');
>>>> $this->router->addMap('/applications/:application_id', 'applications');
>>>> $this->router->addMap('/categories', 'categories');
>>>> $this->router->addMap('/categories/:categories_id', 'categories');
>>>> I was wondering if there is any way to summarize somehow all these rules in
>>>> a single one.
>>>> --
>>>> Thanks,
>>>> Stefan Neculai
>>>> Sent from my iPhone
>>>> On Jun 19, 2012, at 6:39 AM, Sam Moffatt <pasa...@gmail.com> wrote:
Does that mean you are treating categories as something other than content
inside a unified content model? Is that something specific to your
application's structure?
On Tue, Jun 19, 2012 at 3:22 AM, Sam Moffatt <pasa...@gmail.com> wrote:
> You could create a route file and have parsed to add items or
> introspect it from the database to do it that way. Perhaps I'm missing
> something here. It's six routes with distinct looking parameters,
> seems reasonable enough to have six different mappings.
No, I treat them as a content, but I have a specific controller that
extends a basic general content controller. It is needed because of some
API's design constraints.
On Tue, Jun 19, 2012 at 2:55 PM, Elin Waring <elin.war...@gmail.com> wrote:
> Stefan,
> Does that mean you are treating categories as something other than content
> inside a unified content model? Is that something specific to your
> application's structure?
> Elin
> On Tue, Jun 19, 2012 at 3:22 AM, Sam Moffatt <pasa...@gmail.com> wrote:
>> You could create a route file and have parsed to add items or
>> introspect it from the database to do it that way. Perhaps I'm missing
>> something here. It's six routes with distinct looking parameters,
>> seems reasonable enough to have six different mappings.