Skip to content

Instantly share code, notes, and snippets.

View mikeemoo's full-sized avatar

Mikeemoo mikeemoo

  • Leeds, United Kingdom
View GitHub Profile
@mikeemoo
mikeemoo / gist:2763413
Created May 21, 2012 17:26
Generate bundle
php app/console generate:bundle --namespace=Lowpress/WordpressBundle --format=yml
@mikeemoo
mikeemoo / routing.yml
Created May 21, 2012 17:28
Catch all routing symfony2
LowpressWordpressBundle_homepage:
pattern: /{url}
defaults: { _controller: LowpressWordpressBundle:Default:index }
requirements:
url: ".*"
@mikeemoo
mikeemoo / DefaultController.php
Created May 21, 2012 17:29
Broken wordpress load
<?php
namespace Lowpress\WordpressBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
@mikeemoo
mikeemoo / autoload.php
Created May 21, 2012 17:30
Load wordpress into symfony
define('WP_USE_THEMES', true);
require_once(__DIR__.'/../web/wp-load.php');
@mikeemoo
mikeemoo / header.php
Created May 21, 2012 17:31
Showing symfony kernel in a wordpress template
<body <?php body_class(); ?>>
<?php
global $kernel;
die(get_class($kernel));
?>
@mikeemoo
mikeemoo / symfony2-bridge.php
Created May 21, 2012 18:38
symfony2 bridge
<?php
/*
Plugin Name: Symfony2 Bridge
Plugin URI: http://www.lowpress.com
Description: Integrate Symfony2 and Wordpress
Author: Mikee Franklin
Version: 1.0
Author URI: http://www.lowpress.com
*/
?>
@mikeemoo
mikeemoo / DefaultController.php
Created May 21, 2012 20:18
wordpress using twig
<?php
namespace Lowpress\WordpressBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller,
Symfony\Component\HttpFoundation\Response;
class DefaultController extends Controller
{
@mikeemoo
mikeemoo / DefaultController.php
Created May 21, 2012 20:22
Using twig with wordpress
<?php
namespace Lowpress\WordpressBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller,
Symfony\Component\HttpFoundation\Response;
class DefaultController extends Controller
{
@mikeemoo
mikeemoo / DefaultController.php
Created May 21, 2012 20:34
Using twig with wordpress
<?php
namespace Lowpress\WordpressBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller,
Symfony\Component\HttpFoundation\Response;
class DefaultController extends Controller
{
@mikeemoo
mikeemoo / front-page.html.twig
Created May 22, 2012 10:11
Lowpress function calls
{{ lowpress_get_header() }}
{{ lowpress_get_footer() }}