Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47de466
commit 43e6220
Showing
10 changed files
with
176 additions
and
296 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templateSet group="Nette"> | ||
<template name="com" value="/** * @return $CLASS$ */ protected function createComponent$NAME$() { return new $CLASS$($ARGS$);$END$ }" description="component factory" toReformat="true" toShortenFQNames="true"> | ||
<variable name="CLASS" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" /> | ||
<variable name="ARGS" expression="" defaultValue="" alwaysStopAt="true" /> | ||
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" /> | ||
<context> | ||
<option name="PHP" value="true" /> | ||
</context> | ||
</template> | ||
<template name="sig" value="/***/ public function handle$NAME$($PARAMS$) { $END$ }" description="signal factory" toReformat="true" toShortenFQNames="true"> | ||
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" /> | ||
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" /> | ||
<context> | ||
<option name="PHP" value="true" /> | ||
</context> | ||
</template> | ||
<template name="att" value="/** * @param \Nette\ComponentModel\Container $obj */ protected function attached($obj) { 	parent::attached($obj); 	if (!$obj instanceof \Nette\Application\UI\Presenter) { 		return; 	} 	$END$ }" description="component attached event" toReformat="true" toShortenFQNames="true"> | ||
<context> | ||
<option name="PHP" value="true" /> | ||
</context> | ||
</template> | ||
<template name="obj" value="	/*************************** Nette\Object ***************************/ 	/** 	 * Access to reflection. 	 * @return \Nette\Reflection\ClassType 	 */ 	public static function getReflection() 	{ 		return new Nette\Reflection\ClassType(get_called_class()); 	} 	/** 	 * Call to undefined method. 	 * 	 * @param string $name 	 * @param array $args 	 * 	 * @throws \Nette\MemberAccessException 	 * @return mixed 	 */ 	public function __call($name, $args) 	{ 		return Nette\ObjectMixin::call($this, $name, $args); 	} 	/** 	 * Call to undefined static method. 	 * 	 * @param string $name 	 * @param array $args 	 * 	 * @throws \Nette\MemberAccessException 	 * @return mixed 	 */ 	public static function __callStatic($name, $args) 	{ 		return Nette\ObjectMixin::callStatic(get_called_class(), $name, $args); 	} 	/** 	 * Adding method to class. 	 * 	 * @param $name 	 * @param null $callback 	 * 	 * @throws \Nette\MemberAccessException 	 * @return callable|null 	 */ 	public static function extensionMethod($name, $callback = NULL) 	{ 		if (strpos($name, '::') === FALSE) { 			$class = get_called_class(); 		} else { 			list($class, $name) = explode('::', $name); 		} 		if ($callback === NULL) { 			return Nette\ObjectMixin::getExtensionMethod($class, $name); 		} else { 			Nette\ObjectMixin::setExtensionMethod($class, $name, $callback); 		} 	} 	/** 	 * Returns property value. Do not call directly. 	 * 	 * @param string $name 	 * 	 * @throws \Nette\MemberAccessException 	 * @return mixed 	 */ 	public function &__get($name) 	{ 		return Nette\ObjectMixin::get($this, $name); 	} 	/** 	 * Sets value of a property. Do not call directly. 	 * 	 * @param string $name 	 * @param mixed $value 	 * 	 * @throws \Nette\MemberAccessException 	 * @return void 	 */ 	public function __set($name, $value) 	{ 		Nette\ObjectMixin::set($this, $name, $value); 	} 	/** 	 * Is property defined? 	 * 	 * @param string $name 	 * 	 * @return bool 	 */ 	public function __isset($name) 	{ 		return Nette\ObjectMixin::has($this, $name); 	} 	/** 	 * Access to undeclared property. 	 * 	 * @param string $name 	 * 	 * @throws \Nette\MemberAccessException 	 * @return void 	 */ 	public function __unset($name) 	{ 		Nette\ObjectMixin::remove($this, $name); 	}" description="Nette\Object mixin" toReformat="true" toShortenFQNames="true"> | ||
<context> | ||
<option name="PHP" value="true" /> | ||
</context> | ||
</template> | ||
<template name="inj" value="/** * @param $HINT$ $$$SERVICE$ */ public function inject$SERVICE_UPER$($HINT$ $$$SERVICE$) { $this->$SERVICE$ = $$$SERVICE$;$END$ }" description="inject function" toReformat="true" toShortenFQNames="true"> | ||
<variable name="SERVICE" expression="" defaultValue="" alwaysStopAt="true" /> | ||
<variable name="HINT" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" /> | ||
<variable name="SERVICE_UPER" expression="capitalize(SERVICE)" defaultValue="" alwaysStopAt="false" /> | ||
<context> | ||
<option name="PHP" value="true" /> | ||
</context> | ||
</template> | ||
<template name="sup" value="protected function startup() { parent::startup(); $END$ }" description="startup method" toReformat="true" toShortenFQNames="true"> | ||
<context> | ||
<option name="PHP" value="true" /> | ||
</context> | ||
</template> | ||
<template name="form" value="/** * @return $FORM_CLASS$ */ protected function createComponent$NAME$() { 	$$form = new $FORM_CLASS$(); 	$END$ $$form->addSubmit("send", "Odeslat"); 	$$form->onSuccess[] = $this->$HANDLER$Succeeded; 	return $$form; } /** * @param $FORM_CLASS$ $$form */ public function $HANDLER$Succeeded($FORM_CLASS$ $$form) { 	throw new Nette\NotImplementedException; }" description="Form component factory + handler" toReformat="false" toShortenFQNames="true"> | ||
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" /> | ||
<variable name="FORM_CLASS" expression="enum("Form", "UI\\Form", "Nette\\Application\\UI\\Form")" defaultValue="Form" alwaysStopAt="true" /> | ||
<variable name="HANDLER" expression="decapitalize(NAME)" defaultValue="" alwaysStopAt="false" /> | ||
<context> | ||
<option name="PHP" value="true" /> | ||
</context> | ||
</template> | ||
<template name="ren" value="public function render$VIEW$($PARAMS$) { 	$END$ }" description="Render method" toReformat="false" toShortenFQNames="true"> | ||
<variable name="VIEW" expression="" defaultValue="" alwaysStopAt="true" /> | ||
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" /> | ||
<context> | ||
<option name="PHP" value="true" /> | ||
</context> | ||
</template> | ||
<template name="act" value="public function action$ACTION$($PARAMS$) { 	$END$ }" description="Action method" toReformat="false" toShortenFQNames="true"> | ||
<variable name="ACTION" expression="" defaultValue="" alwaysStopAt="true" /> | ||
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" /> | ||
<context> | ||
<option name="PHP" value="true" /> | ||
</context> | ||
</template> | ||
</templateSet> | ||
|
Oops, something went wrong.