File tree Expand file tree Collapse file tree 3 files changed +4
-13
lines changed
user_guide_src/source/outgoing Expand file tree Collapse file tree 3 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -426,20 +426,11 @@ Custom Filters
426426--------------
427427
428428You can easily create your own filters by editing **app/Config/View.php ** and adding new entries to the
429- ``$filters `` array. Each key is the name of the filter is called by in the view, and its value is any valid PHP
429+ ``$filters `` array. Each key is the name which the filter is called by in the view, and its value is any valid PHP
430430callable:
431431
432432.. literalinclude:: view_parser/012.php
433433
434- PHP Native functions as Filters
435- -------------------------------
436-
437- You can use native php function as filters by editing **app/Config/View.php ** and adding new entries to the
438- ``$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
439- function prefixed with:
440-
441- .. literalinclude:: view_parser/013.php
442-
443434Parser Plugins
444435==============
445436
Original file line number Diff line number Diff line change 77class View extends BaseView
88{
99 public $ filters = [
10- 'abs ' => '\CodeIgniter\View\Filters::abs ' ,
11- 'capitalize ' => '\CodeIgniter\View\Filters::capitalize ' ,
10+ 'foo ' => '\Some\Class::methodName ' ,
11+ 'str_repeat ' => 'str_repeat ' , // native php function
1212 ];
1313
1414 // ...
Original file line number Diff line number Diff line change 11<?php
22
3- return $ parser ->render ( ' myview ' );
3+ return $ parser ->renderString ( ' <ul><li>Item 1</li><li>Item 2</li></ul> ' );
You can’t perform that action at this time.
0 commit comments