diff --git a/user_guide_src/source/outgoing/view_parser.rst b/user_guide_src/source/outgoing/view_parser.rst index 206cebdd2698..1c09d8c36486 100644 --- a/user_guide_src/source/outgoing/view_parser.rst +++ b/user_guide_src/source/outgoing/view_parser.rst @@ -426,20 +426,11 @@ Custom Filters -------------- You can easily create your own filters by editing **app/Config/View.php** and adding new entries to the -``$filters`` array. Each key is the name of the filter is called by in the view, and its value is any valid PHP +``$filters`` array. Each key is the name which the filter is called by in the view, and its value is any valid PHP callable: .. literalinclude:: view_parser/012.php -PHP Native functions as Filters -------------------------------- - -You can use native php function as filters by editing **app/Config/View.php** and adding new entries to the -``$filters`` array.Each key is the name of the native PHP function is called by in the view, and its value is any valid native PHP -function prefixed with: - -.. literalinclude:: view_parser/013.php - Parser Plugins ============== diff --git a/user_guide_src/source/outgoing/view_parser/012.php b/user_guide_src/source/outgoing/view_parser/012.php index 000642837149..696bd2d29c22 100644 --- a/user_guide_src/source/outgoing/view_parser/012.php +++ b/user_guide_src/source/outgoing/view_parser/012.php @@ -7,8 +7,8 @@ class View extends BaseView { public $filters = [ - 'abs' => '\CodeIgniter\View\Filters::abs', - 'capitalize' => '\CodeIgniter\View\Filters::capitalize', + 'foo' => '\Some\Class::methodName', + 'str_repeat' => 'str_repeat', // native php function ]; // ... diff --git a/user_guide_src/source/outgoing/view_parser/023.php b/user_guide_src/source/outgoing/view_parser/023.php index 1bdb256d92f1..8e65d489f492 100644 --- a/user_guide_src/source/outgoing/view_parser/023.php +++ b/user_guide_src/source/outgoing/view_parser/023.php @@ -1,3 +1,3 @@ render('myview'); +return $parser->renderString('');