note 124863 added to function.eval

From: Date: Sun, 29 Mar 2020 14:42:07 +0000
Subject: note 124863 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-214388@lists.php.net to get a copy of this message
In 2020, many people don't want to mix their PHP code and HTML, and they also think PHP itself is better than any template engines. But whenever you are making an template engine, use "include" to include your view file instead of using eval(). Many farmeworks are using this solution, such as Laravel. If you rally want to eval a string, write them to a cached .php file first, then include it. ---- Server IP: 45.112.84.4 Probable Submitter: 38.142.137.34 (proxied: 42.3.63.80) ---- Manual Page -- http://php.net/manual/en/function.eval.php Edit -- https://master.php.net/note/edit/124863 Del: integrated -- https://master.php.net/note/delete/124863/integrated Del: useless -- https://master.php.net/note/delete/124863/useless Del: bad code -- https://master.php.net/note/delete/124863/bad+code Del: spam -- https://master.php.net/note/delete/124863/spam Del: non-english -- https://master.php.net/note/delete/124863/non-english Del: in docs -- https://master.php.net/note/delete/124863/in+docs Del: other reasons-- https://master.php.net/note/delete/124863 Reject -- https://master.php.net/note/reject/124863 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214388) next »