Created
October 5, 2012 09:45
-
-
Save fprochazka/3838981 to your computer and use it in GitHub Desktop.
Velocity http://velocity.apache.org/engine/ template for PhpStorm & #nettefw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#set( $Class_prefix = ${NAME.substring(0, $NAME.indexOf('Extension'))} ) | |
#set( $Extension_name = ${Class_prefix.toLowerCase()} ) | |
#parse("PHP File Header.php") | |
namespace Kdyby\Extension\\${Class_prefix}; | |
use Kdyby; | |
use Nette; | |
/** | |
* @author Filip Procházka <[email protected]> | |
*/ | |
class ${Class_prefix}Extension extends Nette\Config\CompilerExtension | |
{ | |
/** | |
* @var array | |
*/ | |
public \$defaults = array( | |
); | |
public function loadConfiguration() | |
{ | |
\$builder = \$this->getContainerBuilder(); | |
\$config = \$this->getConfig(\$this->defaults); | |
} | |
/** | |
* @param \Nette\Config\Configurator \$configurator | |
*/ | |
public static function register(Nette\Config\Configurator \$configurator) | |
{ | |
\$configurator->onCompile[] = function (\$config, Nette\Config\Compiler \$compiler) { | |
\$compiler->addExtension('${Extension_name}', new ${Class_prefix}Extension()); | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment