Development

/plugins/nahoClassHelpersPlugin/lib/nahoClassHelpersApplicationConfiguration.php

You must first sign up to be able to contribute.

root/plugins/nahoClassHelpersPlugin/lib/nahoClassHelpersApplicationConfiguration.php

Revision 17324, 1.1 kB (checked in by naholyr, 4 years ago)

nahoClassHelpersPlugin - first release

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Rev URL"
Line 
1 <?php
2
3 class nahoClassHelpersApplicationConfiguration extends sfApplicationConfiguration
4 {
5  
6   /**
7    * @var nahoClassHelpersLoaderInterface
8    */
9   protected $loader = null;
10  
11   /**
12    * Supports helpers as classes (new flavour) or as functions (old way).
13    *
14    * @see sntLoader
15    *
16    * @param array $helpers
17    * @param string $moduleName
18    * @param boolean $oldWayOnly
19    */
20   public function loadHelpers($helpers, $moduleName = '', $oldWayOnly = false)
21   {
22     if ($oldWayOnly)
23     {
24       parent::loadHelpers($helpers, $moduleName);
25     }
26     else
27     {
28       if (is_null($this->loader))
29       {
30         $loaderClass = sfConfig::get('app_nahoClassHelpersPlugin_loader', 'nahoClassHelpersLoader');
31         $generatorClass = sfConfig::get('app_nahoClassHelpersPlugin_generator', 'nahoClassHelpersGenerator');
32         
33         $this->loader = new $loaderClass($this, new $generatorClass());
34       }
35       
36       if (!is_array($helpers))
37       {
38         $helpers = array($helpers);
39       }
40       
41       $this->loader->loadHelpers($helpers, $moduleName);
42     }
43   }
44  
45 }
Note: See TracBrowser for help on using the browser.