Skip to content

Instantly share code, notes, and snippets.

View treetop1500's full-sized avatar

Robert Wade treetop1500

  • Gray Loon Marketing Group
  • Salt Lake City, Utah
View GitHub Profile
@treetop1500
treetop1500 / doctrine_extensions.yml
Created September 15, 2016 14:29
doctrine extensions yml file for Gedmo extensions
# 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
@treetop1500
treetop1500 / twig_extension_icon.txt
Last active September 14, 2016 20:44
Twig Extensions
/**
* @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>";
@treetop1500
treetop1500 / Product.php
Created September 12, 2016 16:57
Product Entity for Symfony3 Projects (Extends BaseContent)
<?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;
@treetop1500
treetop1500 / Page.php
Created September 12, 2016 16:55
Page Entity for Symfony 3 Projects (Extends BaseContent)
<?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;
@treetop1500
treetop1500 / BaseContent.php
Created September 12, 2016 16:54
Base Content Entity for Symfony 3 projects
<?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;