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 | |
namespace Common\ContentBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use DoctrineExtensions\Taggable\Taggable; | |
use Symfony\Component\Validator\Constraints as Assert; | |
use Symfony\Component\HttpFoundation\File\File; | |
use Vich\UploaderBundle\Mapping\Annotation as Vich; | |
use Gedmo\Mapping\Annotation as Gedmo; |
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 | |
namespace Common\ContentBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Validator\Constraints as Assert; | |
use Vich\UploaderBundle\Mapping\Annotation as Vich; | |
use Gedmo\Mapping\Annotation as Gedmo; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Common\ContentBundle\Entity\BaseContent; |
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 | |
namespace Common\ContentBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Validator\Constraints as Assert; | |
use Symfony\Component\HttpFoundation\File\File; | |
use Vich\UploaderBundle\Mapping\Annotation as Vich; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Gedmo\Mapping\Annotation as Gedmo; |
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
/** | |
* @param string $class | |
* @return string | |
* returns a proper, accessible font-awesome icon. | |
* usage: {{ icon('fa-download') }} | |
*/ | |
function icon($class) | |
{ | |
return "<i class=\"fa $class\" aria-hidden=\"true\"></i>"; |
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
# services to handle doctrine extensions | |
# import it in config.yml | |
services: | |
# KernelRequest listener | |
extension.listener: | |
class: AppBundle\Listener\DoctrineExtensionListener | |
calls: | |
- [ setContainer, [ "@service_container" ] ] | |
tags: | |
# translatable sets locale after router processing |
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
/** | |
* @param $amt | |
* @return string | |
* strips out non-numeric characters and adds the +1 country code. | |
*/ | |
function price($amt) | |
{ | |
return '<span class="dollar-sign">$</span>'.number_format($amt,2); | |
} |
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
@mixin alphaColor ($name,$color) { | |
@for $i from 1 through 10 { | |
.c-#{$name}-#{$i} { | |
color: rgba($color,$i/10); | |
} | |
} | |
} | |
@include alphaColor("blue",blue); | |
@include alphaColor("red",#ed1414); |
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
// ---- | |
// Sass (v3.4.21) | |
// Compass (v1.0.3) | |
// ---- | |
.box { | |
@for $i from 0 through 9 { | |
$c : $i + 1; | |
&:nth-child(#{$c}) { | |
order: (($i - $i % 3) / 3) + 1; |
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 | |
/** | |
* Created by PhpStorm. | |
* User: grayloon | |
* Date: 9/3/16 | |
* Time: 7:39 AM | |
* | |
* Set these routes up!! | |
* # froala receive route for file uploads | |
* froala_receiver: |
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
// controller delete action: | |
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException; | |
... | |
try { | |
$em->remove($entity); | |
$em->flush(); | |
} catch(ForeignKeyConstraintViolationException $e) { | |
$this->addFlash('warning', 'This item is in use by related entities and cannot be deleted.'); | |
} |
OlderNewer