Home Backend Development PHP Tutorial smarty的fetch方法不能使用include解决办法

smarty的fetch方法不能使用include解决办法

Jun 13, 2016 am 10:08 AM
code fetch include smarty

smarty的fetch方法不能使用include
兄弟们,我在使用SMARTY模板引擎的时候,制作好的我的模板,模板中用smarty的include包含了文件,可是我用fetch方法解析模板并赋给一个变量,不好用啊.我想把取得的内容保存成一个文件的,现在取不到值 .而且include的部分直接输出了.
我知道可以用smarty变量代替include方法,可是这样作不好.
可以即用include方法,又能用fetdch解析吗>

------解决方案--------------------
又是 SMARTY
我倒想看看是否能得到满意的答复!
------解决方案--------------------
楼上的,反正,这么急嘛,给我得了,呵呵
------解决方案--------------------
细心使得万年船,尤其是code,差一个字符都会出问题的

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if 'TypeError: Failed to fetch' occurs when using axios in a Vue application? What should I do if 'TypeError: Failed to fetch' occurs when using axios in a Vue application? Jun 24, 2023 pm 11:03 PM

Recently, during the development of Vue applications, I encountered a common problem: "TypeError: Failedtofetch" error message. This problem occurs when using axios to make HTTP requests and the backend server does not respond to the request correctly. This error message usually indicates that the request cannot reach the server, possibly due to network reasons or the server not responding. What should we do after this error message appears? Here are some workarounds: Check your network connection due to

What is the difference between php include and include_once What is the difference between php include and include_once Mar 22, 2023 am 10:38 AM

When we write web pages using PHP, sometimes we need to include code from other PHP files in the current PHP file. At this time, you can use the include or include_once function to implement file inclusion. So, what is the difference between include and include_once?

Edit your Unity project in Visual Studio Code and you are now ready to go Edit your Unity project in Visual Studio Code and you are now ready to go Aug 08, 2023 am 10:21 AM

Microsoft has released a preview version of the Unity extension for Visual Studio Code. This new Unity extension will allow you to write and debug Unity games. This new Unity extension brings some popular features already available in Visual Studio and Visual Studio Tools for Unity, making C# in Visual Studio Code better for Unity development. Currently, the Unity extension for VSCode provides the following: A Unity debugger for debugging your Unity editor and Unity player. Unity-specific C# analyzer and refactoring. Uni

Data request and processing experience in Vue project development Data request and processing experience in Vue project development Nov 02, 2023 am 10:35 AM

In Vue project development, data request and processing are very important links. A good data request and processing strategy can greatly improve application performance and user experience. This article will share some experiences in data request and processing in Vue project development. Proper use of the Axios library Axios is a commonly used Promise-based HTTP library for sending XHR requests. In a Vue project, you can use Axios to send data requests. When using Axios, you need to pay attention to the following points: Properly configure A

How to use PHP and Smarty to achieve front-end and back-end separation development How to use PHP and Smarty to achieve front-end and back-end separation development Jun 25, 2023 pm 01:46 PM

In modern web development, the separation of front-end and back-end has become a very popular trend, which allows developers to better organize projects and improve the efficiency of project development. PHP and Smarty are two very commonly used technologies, which can be used to achieve front-end and back-end separation development. This article will introduce how to use PHP and Smarty to achieve front-end and back-end separation development. What is front-end and back-end separation development? In traditional web development, the front-end is mainly responsible for the presentation of the page and the logic of interaction with the back-end. The backend is mainly responsible for the business

A preliminary study on the template engine Smarty in PHP A preliminary study on the template engine Smarty in PHP May 11, 2023 pm 05:15 PM

Nowadays, website development is inseparable from an important component-template engine. A template engine refers to a tool that combines page templates and data to generate HTML code with a specific format. In various website development frameworks, the template engine is an essential component, because the template engine can greatly reduce the duplication of code and improve the dynamics of the page. One of the most common and popular template engines is Smarty. Smarty is a DSL (DomainSpecif

How to use Smarty template engine in PHP development How to use Smarty template engine in PHP development Jun 27, 2023 pm 01:28 PM

As a PHP developer, using a template engine is a natural choice. Smarty is a popular template engine that provides a way to separate HTML/CSS/JavaScript from PHP code, allowing developers to better organize and manage projects. In this article, we will learn how to use Smarty template engine during PHP development. 1. Install Smarty Before, we must install Smarty. In this article we will use Composer to install

How to use thinkphp fetch method How to use thinkphp fetch method Jun 03, 2023 am 08:43 AM

First of all, the fetch method is a rendering method in the ThinkPHP framework. This method is mainly used to load the view page and render it. This method is defined in the View class of the ThinkPHP framework, therefore, we need to find the View class first. The path of the View class in the ThinkPHP framework is as follows: thinkphp/library/think/View.php. We can find the source code file where the View class is located through this path. Open the View.php source file, we can see that the fetch() method is defined in the View class, its code is as follows: /***Rendering template output*@acces

See all articles