Skip to content

Instantly share code, notes, and snippets.

@madflow
madflow / symfony2-git-boilerplate.sh
Created June 4, 2011 16:30 — forked from domdoescode/symfony2-git-boilerplate.sh
Creating a Symfony2 project, git init, and adding html5-boilerplate default awesome (in twig format)
#!/bin/bash
SYMFONY="Symfony_Standard_Vendors_2.0.0BETA3.tgz"
APPLICATION_ROOT="/var/www"
REMOTE_IP="127.0.0.1"
DB_HOST="localhost"
DB_DRIVER="pdo_pgsql"
DB_USER="test"
DB_PASSWORD="test"
echo "Please enter the company name and project name (in the format CompanyName ProjectName)"
@marijn
marijn / terms-and-conditions-in-label.twig
Created November 23, 2012 21:54
This is how you add a link to a label with Symfony forms, sort of. Cause you'll have a label tag twice...
{% set terms_link %}<a title="{% trans %}Read the General Terms and Conditions{% endtrans %}" href="{{ path('get_general_terms_and_conditions') }}">{% trans %}General Terms and Conditions{% endtrans %}</a>{% endset %}
{% set general_terms_and_conditions %}{{ 'I have read and accept the %general_terms_and_conditions%.'|trans({ '%general_terms_and_conditions%': terms_link })|raw }}{% endset %}
<div>
{{ form_errors(form.acceptGeneralTermsAndConditions) }}
{{ form_widget(form.acceptGeneralTermsAndConditions) }}
<label for="{{ form.acceptGeneralTermsAndConditions.vars.id }}">{{ general_terms_and_conditions|raw }}</label>
</div>