Browse | Submit New Snippet | Create Package

 

Textile Component

Type:
Class
Category:
HTML Manipulation
License:
GNU General Public License
Language:
PHP
 
Description:
Wrapper Component for Textile.

See http://textile.thresholdstate.com/

Versions Of This Snippet::

Travis Cline
Snippet ID Download Version Date Posted Author Delete
3150.12007-05-16 00:32Travis Cline

Download a raw-text version of this code by clicking on "Download Version"

 


Latest Snippet Version: :0.1

<?php
/**
 * Textile Component Class for CakePHP
 *
 * Requires classTextile.php to be within a vendor directory.
 * 
 * @version 	0.1
 * @author 	tclineks
 * @see 	http://textile.thresholdstate.com/
 * @license 	http://www.opensource.org/licenses/mit-license.php The MIT License
 */

vendor('classTextile');

/**
 * Textile Component class
 */
class TextileComponent extends Object {
	
	var $textile;
	
	/**
	 * Creates textile object
	 */
	function startup(&$controller) {
		$this->textile = new Textile();
		if (!is_a($this->textile, 'Textile')) {
			trigger_error('Textile could not be initalized');
		}
	}
	
	/**
	 * Wrapper for TextileThis
	 */
	function TextileThis($text, $lite='', $encode='', $noimage='', $strict='', $rel=''){
		$this->init();
		return $this->textile->TextileThis($text, $lite='', $encode='', $noimage='', $strict='', $rel='');
	}
	
	/**
	 * Wrapper for TextileRestricted
	 */
	function TextileRestricted($text, $lite=1, $noimage=1, $rel='nofollow'){
		$this->init();
		return $this->textile->TextileRestricted($text, $lite=1, $noimage=1, $rel='nofollow');
	}

}

?>
		

Submit a new version

You can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..