Created
September 13, 2011 23:59
-
-
Save ushis/1215513 to your computer and use it in GitHub Desktop.
Basic usage of the output class
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 | |
# Uses the default rules | |
echo Output::parse($input); | |
echo Output::factory($input)->get(); | |
# Remove some rules | |
echo Output::factory($input)->remove_rules(array('em', 'strong'))->get(); | |
# Add and update some rules | |
echo Output::factory($input) | |
->update_rules(array( | |
'underline' => array('/\_+\s*([^\_\n]*[^\_\s])\s*\_+/' => '<span class="underline">\1</span'), | |
'em' => array('/\'+\s*([^\'\n]*[^\'\s])\s*\'+/' => '<em>\1</em>'), | |
)) | |
->get(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment