Skip to content

Instantly share code, notes, and snippets.

@mrkodssldrf
Created September 23, 2012 09:07
Show Gist options
  • Save mrkodssldrf/3769429 to your computer and use it in GitHub Desktop.
Save mrkodssldrf/3769429 to your computer and use it in GitHub Desktop.
Simple Gist Plugin for PyroCMS
<?php
/**
* Gist Plugin
*
* Simple Plugin to fetch a gist from github
*
* usage: {{gist:get id="gistid"}}
*
* @author Mirko Düßeldorf
* @package PyroCMS/addons/plugin
* @copyright Copyright (c) 2012, Mirko Düßeldorf
*/
class Plugin_Gist extends Plugin {
public function get() {
$id = $this->attribute('id', '0');
if($id != '0') {
return '<script src="http://gist.github.com/'.$id.'.js"></script>';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment