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
{% import 'macro.html.twig' as macro %} | |
{{ attribute(macro, 'type_1', 'Foobar') }} {# <p>Type One Foobar</p> #} | |
{{ attribute(macro, 'type_2', 'Barfoo') }} {# <p>Type Two Barfoo</p> #} |
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
<?php | |
namespace Tentacode\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\Form\DataTransformerInterface; | |
class PictureType extends AbstractType implements DataTransformerInterface | |
{ |
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
<?php | |
namespace Context; | |
class RegistrationContext extends BaseContext | |
{ | |
/** | |
* @When I go to the registration page | |
*/ | |
public function iGoToTheRegistrationPage() |
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
<?php | |
namespace Tentacode\App\Security; | |
trait ConnectedUser | |
{ | |
/** | |
* @Inject | |
* @var Symfony\Component\Security\Core\SecurityContext | |
*/ |
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
<?php | |
// src/Tentacode/LolcatBundle/Doctrine/Mysql/GroupConcat.php | |
namespace Tentacode\LolcatBundle\Doctrine\Mysql; | |
use Doctrine\ORM\Query\AST\Functions\FunctionNode; | |
use Doctrine\ORM\Query\Lexer; | |
use Doctrine\ORM\Query\SqlWalker; | |
use Doctrine\ORM\Query\Parser; |
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
<?php | |
// src/Tentacode/LolcatBundle/Form/CrazyCatLadyType.php | |
namespace Tentacode\LolcatBundle\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
class CrazyCatLadyType extends AbstractType |
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
<form action="..." data-unsaved-warning> | |
<!-- Something something the form --> | |
</form> |
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
<?php | |
function isRequired($object, $property, $validationGroups = ['Default']) | |
{ | |
$classMetadata = $this->validator->getMetadataFor($object); | |
$propertyMetadatas = $classMetadata->getPropertyMetadata($property); | |
foreach ($propertyMetadatas as $propertyMetadata) { | |
$constraintsByGroups = $propertyMetadata->constraintsByGroup; |
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
{% block form_rows %} | |
{% spaceless %} | |
{% for child in form if child.vars.block_prefixes.1 != 'submit' %} | |
{{ form_row(child) }} | |
{% endfor %} | |
{% for child in form if child.vars.block_prefixes.1 == 'submit' %} | |
{{ form_row(child) }} | |
{% endfor %} | |
{% endspaceless %} | |
{% endblock form_rows %} |
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
{% macro form_fields(form) %} | |
{% for field in form %} | |
{% if field.vars.block_prefixes[0] != 'button' %} | |
{{ form_row(field) }} | |
{% endif %} | |
{% endfor %} | |
{% endmacro %} | |
{% import _self as macros %} |