-
Notifications
You must be signed in to change notification settings - Fork 45
Creating filters
filters are a post processor for contents output, content output is passed to filter and it make some changes, addition, modefications the n produce the final output
filters could be nested, like photoshop filter, you can apply a filter1, filter2, filter3, every filter will get the previous filter output and process it the output another text.
you can use filters to remove bad words, add borders, remove HTML tags, generate gallery from UL, or even replace strings, the possibilities are unlimited.
filters reside in application/views/filter
it is a codeigniter php view file (normal php file).
every filter file when loaded Egypt will pass 2 variables
-
text : that is the content output, you can process the
echo()
the final output -
id : the current content
id
in case you want to get the content and make process or grab information from it
this is a filter that will remove HTML tags from any content output producing a plain text
<?= strip_tags( $text ); ?>
that filter will create dojo title pane around the content
<?php
$ci =& get_instance();
$ci->load->library( 'gui' );
$cont = new Content();
$cont->get_by_id($id);
echo $ci->gui->titlepane( $cont->title, $text);
?>
filters are fun, have a look at photoshop image filter, GIMP filters, and you get the idea and inspiration you need.