|
I currently have a few routes configured and these work well.
I also use the URL View Helper to create urls. The problem with the URL View Helper is that I always need to specify the correct route to use. This means specifying it as a string. Does anyone have a method of organising all these route names using something like const(s) so that you only specify the string route name in one place? How would you do this, get still maintain modularity and loose coupling between modules? |
|
Mary Nicole Hicks wrote:
> Does anyone have a method of organising all these route names using > something like const(s) so that you only specify the string route name in > one place? I don't get it. Where's the benefit in using CONST vs string? Maybe you could explain what you would like it to be by presenting a use case. -- Michał Minicki aka Martel Valgoerad | [hidden email] | http://aie.pl/martel.asc =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= "Idleness is not doing nothing. Idleness is being free to do anything." -- Floyd Dell |
|
I don't really understand the question either. The issue of const's is neglegient though. I always prefer to use const's. What are you trying to do though? Why do you have so many routes? Why not use an xml storage for these routes, and load everything in one function? For instance, here's a function I have for loading plugins:
public function setPlugins() { $plugins = array(); foreach(Hornet::getConfig('global/controller/front/plugins')->children() as $module=>$pluginInfo) { $plugins[$module] = array(); foreach($pluginInfo->children() as $pluginName=>$plugin) { $pluginClassName = uc_words($module); if($plugin->is('active')){ $pluginClassName .= '_Controller_Plugin_' . $pluginName; $this->registerPlugin(new $pluginClassName,$plugin->get('stackIndex',null)); } } } return $this; } And Here's the XML Source: <controller> <front> <plugins> <Core> <ViewSetup> <active>1</active> <stackIndex>98</stackIndex> </ViewSetup> <ActionSetup> <active>1</active> </ActionSetup> </Core> </plugins> </front> </controller>
|
| Powered by Nabble | Edit this page |
