Install Package Control for easy package management.
- Open the console with
Ctrl+` - Paste in the following:
| use Symfony\Component\Console\Input\InputInterface; | |
| use Symfony\Component\Console\Output\OutputInterface; | |
| use Symfony\Component\DependencyInjection\ContainerInterface; | |
| class CommandSpec extends ObjectBehavior | |
| { | |
| function it_has_a_name() | |
| { | |
| $this->getName()->shouldReturn('name:command'); | |
| } |
| rabbitmqctl add_user test test | |
| rabbitmqctl set_user_tags test administrator | |
| rabbitmqctl set_permissions -p / test ".*" ".*" ".*" |
| <?php | |
| namespace AppBundle\Controller; | |
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
| use Psr\Log\LoggerInterface; | |
| /** | |
| * This class is now a service, so you can use normal __construct DI if you want! | |
| */ |
| class FormErrorsSerializer { | |
| public function serializeFormErrors(\Symfony\Component\Form\Form $form, $flat_array = false, $add_form_name = false, $glue_keys = '_') | |
| { | |
| $errors = array(); | |
| $errors['global'] = array(); | |
| $errors['fields'] = array(); | |
| foreach ($form->getErrors() as $error) { | |
| $errors['global'][] = $error->getMessage(); |
Install Package Control for easy package management.
Ctrl+`
| <?php | |
| /** | |
| * Implements hook_form_alter(). | |
| * | |
| * Redirects user logins to the front page. | |
| */ | |
| function HOOK_form_user_login_alter(&$form, &$form_state) { | |
| $form['#action'] = url('user', array('query' => array('destination' => '<front>'))); | |
| } |
| var App = { | |
| myProperty : 'someValue', | |
| jqueryVar1 : $('.someClass'), | |
| jqueryVar2 : $('.someOtherClass'), | |
| jqueryVar3 : $('#id'), | |
| myConfig:{ | |
| useCaching:true, | |
| language: 'en' | |
| }, |