Created
September 23, 2012 09:07
-
-
Save mrkodssldrf/3769429 to your computer and use it in GitHub Desktop.
Simple Gist Plugin for PyroCMS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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