This file contains hidden or 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
<!-- Let's say we have a "block" that displays a product's title and price: --> | |
<div class="product-meta"> | |
<h2 class="product-meta__title">Foo</h2> | |
<p class="product-meta__price">Price</h2> | |
</div> | |
<!-- This block has specific styling on a given page. There are other pages when this block is actually included | |
inside another block. Most styles will be the same, but with very little variations.--> |
This file contains hidden or 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
<header class="header" role="banner"> | |
<div class="header__wrapper"> | |
<!-- Le plus "logique" serait "header__item__sidebar-toggle" mais c'est trop lourd. J'ai aussi pensé à créer un | |
nouveau "contexte" et faire header-item__sidebar-toggle mais je trouvais ça illogique d'avoir header__item et header-item | |
sur le même élément !--> | |
<div class="header__item header__item__sidebar-toggle"> | |
<a href="#"></a> | |
</div> | |
</div> | |
</header> |
This file contains hidden or 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
private function convertToZfResponse(ResponseInterface $response) | |
{ | |
$zfResponse = new HttpResponse(); | |
$zfResponse->setStatusCode($response->getStatusCode()); | |
$zfResponse->setReasonPhrase($response->getReasonPhrase()); | |
$zfResponse->setContent((string) $response->getBody()); | |
foreach ($response->getHeaders() as $name => $values) { | |
$zfResponse->getHeaders()->addHeaderLine($name, implode(", ", $values)); |
This file contains hidden or 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
.new-products { | |
background-color: $index-newest-products-background; | |
.product-list { | |
.grid-item { | |
@include grid($index-newest-products-items-per-row, $index-newest-products-horizontal-gutter, $index-newest-products-vertical-gutter); | |
} | |
} | |
.index-section-title { |
This file contains hidden or 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
.newest-products { | |
.products-list { | |
.grid-item { | |
@include grid($home-items-per-row, $home-horizontal-gutter, $home-vertical-gutter); | |
} | |
} | |
.price { | |
color: red; // Ceci ne s'applique que pour le .price contenu dans .newest-products | |
} |
This file contains hidden or 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
.collection, | |
.search { | |
.products-list { | |
.grid-item { | |
@include grid($collection-items-per-row, $collection-horizontal-gutter, $collection-vertical-gutter); | |
} | |
} | |
} | |
.products-list { |
This file contains hidden or 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 | |
class UserRegistrationService | |
{ | |
private $em; | |
private $service1; | |
private $service2; | |
This file contains hidden or 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 | |
class UserController | |
{ | |
/** | |
* @var EntityManagerInterface | |
*/ | |
private $entityManager; | |
public function create() |
This file contains hidden or 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 | |
class Foo | |
{ | |
public function myMethod() | |
{ | |
$myData = []; | |
// MyData is filled with approximately 50-500 elements, but with a lot of attributes inside each element. | |
// BUT one of the property inside each element is an iterator. Therefore each element looks a bit like this: |
This file contains hidden or 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
// ------------------------ | |
// Organization n°1: put all the media queries at the end of the stylesheet | |
// ------------------------ | |
.rule1 { | |
width: 100%; | |
h1 { | |
color: red; | |
} |