dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] Adding a "page" parameter on the controller module


From: Laurent Destailleur (eldy)
Subject: Re: [Dolibarr-dev] Adding a "page" parameter on the controller module
Date: Sat, 04 Aug 2012 17:57:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0


By experience, using a "common page" for controler is an awful thing, making debug very complex.
This looks good in theory, but in real life, this make things obscure, reduce ability to easily found pages when you make debug and even when you code.
Also when you have to manage special cases, a unique controller make everything more complexe, above all when you have to pass parameters using different ways (GET, POST, COOKIE, SESSION).

"If there is no difference between theory and real life, in real life, there is difference"


Each feature type has its own page (creation is really too different than listing to have same entry page, presentation, like actions and parameters are too different). And common part can still be added by using an include, so no need to make more.
I know this way of working come from Java framework, but I use every day such framework and I can tell this is really an awful way of working, really really not efficient.

However, for you own code/module, you can do like you want.
:-)

Le 03/08/2012 22:56, Marc-Henri Pamiseux a écrit :

Hi,

It does not seem useful to create PHP pages with redundant code.
Is it possible, in a module, use only one controller instead of the
tradional list.php, fiche.php, etc..

We could set up a referral mechanism using parameters.

For example :
--------------
Instead of using this king of URI :
/publication/subscriber/index.php
=> We could use this model :
/publication/subscriber.php?page=index

Another sample :
----------------
/publication/subscriber.php?page=fiche&action=""
could be the same as :
/publication/subscriber/fiche.php?action=""

I know there is a template mechanism in Dolibarr, but i have not tried
to understand how it works...

Does this URI scheme would allow us to democratize its use?

Best regards,


_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev


-- 
Eldy (Laurent Destailleur).
---------------------------------------------------------------
EMail: address@hidden
Web: http://www.destailleur.fr

Dolibarr (Project leader): http://www.dolibarr.org
To make a donation for Dolibarr project via Paypal: address@hidden
AWStats (Author) : http://awstats.sourceforge.net
To make a donation for AWStats project via Paypal: address@hidden
AWBot (Author) : http://awbot.sourceforge.net
CVSChangeLogBuilder (Author) : http://cvschangelogb.sourceforge.net

reply via email to

[Prev in Thread] Current Thread [Next in Thread]