Skip to content

Instantly share code, notes, and snippets.

View mikeemoo's full-sized avatar

Mikeemoo mikeemoo

  • Leeds, United Kingdom
View GitHub Profile
<?php
namespace Lowpress\CmsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
class Site
{
/**
<?php
namespace Lowpress\CmsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
class Path
{
/**
<?php
namespace Lowpress\CmsBundle\Entity;
use Doctrine\ORM\Mapping as ORM,
class Site
{
/**
<?php
namespace Lowpress\CmsBundle\Entity;
use Doctrine\ORM\Mapping as ORM,
class Path
{
/**
<?php
namespace Lowpress\CmsBundle\Entity;
use Doctrine\ORM\Mapping as ORM,
class HtmlPage extends Path
{
/**
@mikeemoo
mikeemoo / cmsbundle
Created May 29, 2012 10:03
Cms Bundle
php app/console generate:bundle --namespace=Lowpress/CmsBundle --format=yml
@mikeemoo
mikeemoo / cmsdesignpages.php
Created May 25, 2012 18:28
cms design pages
<?php
class HomePage extends HtmlPage {
public $banner_images;
public $left_column;
public $right_column;
}
<?php
class Path {
public $site_id;
public $url;
}
class HtmlPage extends Path {
<?php
class Path {
(int) site_id;
(string) url;
}
class HtmlPage extends Path {
@mikeemoo
mikeemoo / symfony2-bridge.php
Created May 23, 2012 12:29
Bridge templating
<?php
function render_wordpress_twig_template($kernel){
global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
$template = false;
if (is_404()): throw $this->createNotFoundException('The product does not exist');
elseif (is_search()): $template = 'LowpressWordpressBundle:Default:search.html.twig';
elseif (is_tax()): $template = 'LowpressWordpressBundle:Default:taxonomy.html.twig';