thinkphp does not parse u because the template engine will only parse it once, and tag usage that is not in the template file will not be parsed. The solution is to generate it once before putting it in the database, and then save it. .
#The operating environment of this article: Windows 7 system, thinkphp v5.1 version, Dell G3 computer.
What should I do if thinkphp does not parse u?
Thinkphp’s U method cannot correctly parse the problem
When I use ThinkPHP’s U method, for example : Save the {:U(GROUP_NAME . '/Clear/clearCache')} in the template to the database in the form of a string, and then read it out from the database in the background and assign it to the foreground → Clear Cache, the result displayed on the front desk is Clear Cache , the URL generated by the U method is not parsed. What is the reason for this?
Problem analysis:
The template engine will only parse it once. The variables you use will only replace the variables with values, and will not go back after the replacement is completed. Check the value to see if there are tags to be parsed. Therefore, the data you save in the database should be data that does not contain TP tags.
Do not put this statement in the database
Solution: 1. Generate it once before putting it in the database, and then save it, 2. Generate it when using it , recommend the first type.
Recommended learning: "The latest 10 thinkphp video tutorials"
The above is the detailed content of What should I do if thinkphp does not parse u?. For more information, please follow other related articles on the PHP Chinese website!

The article discusses ThinkPHP's built-in testing framework, highlighting its key features like unit and integration testing, and how it enhances application reliability through early bug detection and improved code quality.

Article discusses using ThinkPHP for real-time stock market data feeds, focusing on setup, data accuracy, optimization, and security measures.

The article discusses key considerations for using ThinkPHP in serverless architectures, focusing on performance optimization, stateless design, and security. It highlights benefits like cost efficiency and scalability, but also addresses challenges

The article discusses implementing service discovery and load balancing in ThinkPHP microservices, focusing on setup, best practices, integration methods, and recommended tools.[159 characters]

ThinkPHP's IoC container offers advanced features like lazy loading, contextual binding, and method injection for efficient dependency management in PHP apps.Character count: 159

The article discusses using ThinkPHP to build real-time collaboration tools, focusing on setup, WebSocket integration, and security best practices.

ThinkPHP benefits SaaS apps with its lightweight design, MVC architecture, and extensibility. It enhances scalability, speeds development, and improves security through various features.

The article outlines building a distributed task queue system using ThinkPHP and RabbitMQ, focusing on installation, configuration, task management, and scalability. Key issues include ensuring high availability, avoiding common pitfalls like imprope


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

Atom editor mac version download
The most popular open source editor