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\WordpressBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class LowpressWordpressBundle extends Bundle
{
public function boot()
{
@mikeemoo
mikeemoo / LowpressWordpressBundle.php
Created May 22, 2012 19:05
Wordpress connection
<?php
namespace Lowpress\WordpressBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class LowpressWordpressBundle extends Bundle
{
public function boot()
{
<?php
/***************
*
* My Wordpress plugin
*
*********************/
$myvar = "Hello";
function show_my_var(){
@mikeemoo
mikeemoo / app_dev.php
Created May 23, 2012 12:28
App dev with wordpress
<?php
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$response = $kernel->handle(Request::createFromGlobals());
if ($response->getStatusCode() !== 404)
{
$response->send();
}
@mikeemoo
mikeemoo / app_dev.php
Created May 23, 2012 12:28
Conn details
<?php
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$response = $kernel->handle(Request::createFromGlobals());
if ($response->getStatusCode() !== 404)
{
$response->send();
}
@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';
<?php
class Path {
(int) site_id;
(string) url;
}
class HtmlPage extends Path {
<?php
class Path {
public $site_id;
public $url;
}
class HtmlPage extends Path {
@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;
}
@mikeemoo
mikeemoo / cmsbundle
Created May 29, 2012 10:03
Cms Bundle
php app/console generate:bundle --namespace=Lowpress/CmsBundle --format=yml