Skip to content

Instantly share code, notes, and snippets.

@rgantt
Created June 5, 2011 20:31
Show Gist options
  • Save rgantt/1009388 to your computer and use it in GitHub Desktop.
Save rgantt/1009388 to your computer and use it in GitHub Desktop.
sextile excerpt
<?php
class sextile {
protected $textile;
public function TextileThis( $text, $lite = '', $encode = '', $noimage = '', $strict = '', $rel = '' ) {
return $this->textile->TextileThis( $this->handle_latex( $text ), $lite, $encode, $noimage, $strict, $rel );
}
/**
* Spoof interface compatibility
*/
public function __call( $name, $params ) {
$ret = call_user_func_array( array( $this->textile, $name ), $params );
if( $ret === false )
throw new BadMethodCallException("Method {$name} does not exist in class Textile");
return $ret;
}
public function __construct( Textile $textile ) { /* ... */ }
private function handle_latex( $text ){ /* ... */ }
}
<?php
class Textile {
function Textile() {
// lots of constructor-y stuff
}
function TextileThis( $text, $lite='', $encode='', $noimage='', $strict='', $rel='' ) {
// text is inputted here, and then returned--after filtering--from here
}
/**
* Lots of other methods, most of which should never be called in isolation
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment