Home

Awesome

Nette + Latte + Neon for Sublime Text 3

Latte and Neon syntax highlighting, code completions and Nette snippets for Sublime Text 3.

Installation

Via Package Control:

  1. Press Control + Shift + P on Windows/Linux or Command + Shift + P on OS X
  2. Search Nette + Latte + NEON
  3. Press Enter
  4. Complete!

Via Git:

  1. Go to your Sublime Text packages folder (In ST3 Preferences -> Browse Packages...)
  2. git clone http://github.com/FilipStryk/Nette-Latte-Neon-for-Sublime-Text-3.git
  3. Complete!

Neon syntax highlighting

Neon syntax highlighting

Available snippets:

persist

Persistent property

/**
 * @persistent
 * @var type
 */
public $property;

inject

Inject property

/**
 * @inject
 * @var type
 */
public $property;

act

Action method

public function actionName()
{

}

ren

Render method

public function renderName()
{

}

hand

Handle method

public function handleName()
{
	
}

sup

Stratup method

protected function startup()
{
	parent::startup();
	
}

con

Constructor that calls parent

public function __construct()
{
	parent::__construct();
	
}

inject-method

Inject method

/**
 * @param  Service $service
 */
public function injectService(Service $service)
{
	$this->service = $service;
}

form-component

Component factory with form definition

/**
 * @return Nette\Application\UI\Form
 */
protected function createComponentForm()
{
	$form = new Nette\Application\UI\Form;
	$form->
	$form->addSubmit('send', 'Odeslat');
	$form->onSuccess[] = function (Nette\Application\UI\Form $form) {
		$values = $form->getValues();
	};

	return $form;
}

form-control

Form control class

class SignInForm extends \Nette\Application\UI\Control
{

	/**
	 * @return \Nette\Application\UI\Form
	 */
	protected function createComponentSignInForm()
	{
		$form = new \Nette\Application\UI\Form;
		$form->
		$form->addSubmit('send', 'Odeslat');
		$form->onSuccess[] = ->signInFormSucceeded;

		return $form;
	}

	/**
	 * @param  \Nette\Application\UI\Form  $form
	 * @param  \Nette\Utils\ArrayHash      $values
	 */
	public function SignInFormSucceeded(\Nette\Application\UI\Form $form, \Nette\Utils\ArrayHash $values)
	{
		
	}

}

ifa

Interface form factory

interface ISignInFormFactory
{

	/**
	 * @return SignInForm
	 */
	function create();

}

kdel

Kdyby Events listener

class ApplicationListener extends \Nette\Object implements \Kdyby\Events\Subscriber
{

	/**
	 * @var \Monolog\Logger
	 */
	private $logger;

	/**
	 * @param \Monolog\Logger $logger
	 */
	public function __construct(\Monolog\Logger $logger)
	{
		$this->logger = $logger;
	}

	/**
	 * @return array
	 */
	public function getSubscribedEvents()
	{
		return [
			'Nette\Application\Application::onStartup'
		];
	}

	public function onStartup()
	{
		
	}

}

Completions:

Functions:

Namespaces

Nette\Application

Nette\Database

Nette\Http

Nette\Mail

Nette\Security

Nette\Utils