Parser function - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: Parser function (/showthread.php?tid=75471) |
Parser function - Mostafa Khudair - 02-09-2020 I'm wondering why CodeIgniter doesn't provide parser function to grab Parser Class , so we can use it directly anywhere without calling it as instance. for example: before "as documentation": PHP Code: /* loading parser class through its service. */ I wrote this function and placed it in app/Common.php, "actually just copy and paste" system/Common.php view function and do some few changes to it. PHP Code: function parser(string $name, array $data = [], array $options = []): string after: PHP Code: /* now we can use it in one short line. */ it's works as expected, so can it added officially to CodeIgniter 4? btw I couldn't pull a request on github it's so difficult there. RE: Parser function - mjamilasfihani - 02-10-2020 You can add your code to github then give description there. Most developer have their own style, I think asking request in CI repo is about core of CI |