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=create could be the same as : /publication/subscriber/fiche.php?action=create 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 [email protected] https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
-- Eldy (Laurent Destailleur). --------------------------------------------------------------- EMail: [email protected] Web: http://www.destailleur.fr Dolibarr (Project leader): http://www.dolibarr.org To make a donation for Dolibarr project via Paypal: [email protected] AWStats (Author) : http://awstats.sourceforge.net To make a donation for AWStats project via Paypal: [email protected] AWBot (Author) : http://awbot.sourceforge.net CVSChangeLogBuilder (Author) : http://cvschangelogb.sourceforge.net
_______________________________________________ Dolibarr-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
