Skip to content

Instantly share code, notes, and snippets.

@jmolivas
jmolivas / fields.html.twig
Last active December 24, 2015 10:29
Override date & time inputs more info: How to customize Form Rendering - http://symfony.com/doc/current/cookbook/form/form_customization.html
{# File path: YourBundle / Resources / views / Form / fields.html.twig #}
{% block form_widget_simple %}
{% spaceless %}
{% set type = type|default('text') in ['date','time'] ? 'text' : type|default('text') %}
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
{% endspaceless %}
{% endblock form_widget_simple %}
{# How to use: #}
@jmolivas
jmolivas / platform.make
Last active December 25, 2015 08:29
Drupal 7 default make file + guzzle & composer_autoload
$Id$
; API
api = 2
; Core
core = 7.x
@jmolivas
jmolivas / file.html.twig
Created November 18, 2013 23:49
Customize Form label rendering remove tag & values
{% form_theme form _self %}
{% block form_label %}
{% endblock %}
{{ form_widget(form.field_name) }}
@jmolivas
jmolivas / 0_reuse_code.js
Created January 15, 2014 17:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jmolivas
jmolivas / javascript-data-grid.md
Last active August 29, 2015 13:57
Javascript data grid widget
@jmolivas
jmolivas / EntityRepository.php
Created March 26, 2014 16:30
Entity repository extract
/**
* @param integer $id
*
* @return array
*/
public function findBySomething($id)
{
$queryBuilder = $this->queryBySomething($id);
return $queryBuilder->getQuery()->getResult();