Skip to content

Instantly share code, notes, and snippets.

View RobinBastiaan's full-sized avatar

Robin Bastiaan RobinBastiaan

View GitHub Profile
@hkdobrev
hkdobrev / class-order.php
Last active September 7, 2023 09:08
PHP convention for the order in a class.
<?php namespace Vendor\Library;
use Another\Vendor\Library\ClassName;
abstract class ClassName extends AnotherClass implements Countable, Serializable
{
const CONSTANTS = 'top';
use someTrait, anotherTrait {
anotherTrait::traitMethod insteadof someTrait;
@enricofoltran
enricofoltran / base.html.twig
Created April 3, 2013 14:16
Symfony: display all flash messages in a twig template
{% if app.session.flashbag.peekAll|length > 0 %}
{% for type, messages in app.session.flashbag.all %}
{% for message in messages %}
<div class="{{ type ? type : '' }}">
{{ message|trans({}, domain|default('messages')) }}
</div>
{% endfor %}
{% endfor %}
{% endif %}