In ThinkPHP, I created a public function file common. php in the project Common, and wrote a toHtml () method in it. Then, call {$ list directly in the html template. article_content | toHtml ###} isn't that correct? how can I execute this in a small project? in another slightly complicated project, I will say "Calltoundef ThinkPHP" in common. php method call problems
I created a public function file Common. php in the project common, and wrote a toHtml () method in it.
Then, you can directly call {$ list. article_content | toHtml =###} in the html template ###}
This is correct. how can I execute this operation in a small project,
What about Call to undefined function toHtml () in another slightly complicated project?
------ Solution --------------------
Use standard syntax to check whether the call is successful
TP groups. the common. php directory is different.
------ Solution --------------------
Check whether the file is loaded and use the native php code to test whether the file is successful.
------ Solution --------------------
Is it 2.0?
2.0 of available {: function ()}
If not, you can directly use the php source code.
If the methods in common. php are loaded successfully, they can be called directly in the template and program.
------ Solution --------------------
It is best to use native. I like to use native in any framework.