Heim Backend-Entwicklung PHP-Tutorial 让你的Smarty更聪明_PHP

让你的Smarty更聪明_PHP

Jun 01, 2016 pm 12:34 PM
from href page pages smarty

SMARTY

一、扩展你的Smarty
1、准备功夫
<font size="2"><font face="Verdana">PHP代码:</font><hr></font><code><font color="#000000">
<font color="#0000bb"><br></font><font color="#007700">function </font><font color="#0000bb">Smarty_function_page </font><font color="#007700">( </font><font color="#0000bb">$params</font><font color="#007700">, &</font><font color="#0000bb">$Smarty </font><font color="#007700">)
<br>{
<br>    </font><font color="#0000bb">$href </font><font color="#007700">= </font><font color="#dd0000">'#'</font><font color="#007700">;
<br>    </font><font color="#0000bb">$space </font><font color="#007700">= </font><font color="#dd0000">' '</font><font color="#007700">;
<br>
<br>    </font><font color="#0000bb">$frist </font><font color="#007700">= </font><font color="#0000bb">NULL</font><font color="#007700">;
<br>    </font><font color="#0000bb">$last </font><font color="#007700">= </font><font color="#0000bb">NULL</font><font color="#007700">;
<br>
<br>    </font><font color="#0000bb">$page </font><font color="#007700">= </font><font color="#0000bb">5</font><font color="#007700">;
<br>
<br>    </font><font color="#0000bb">extract</font><font color="#007700">(</font><font color="#0000bb">$params</font><font color="#007700">);
<br>
<br>    if ( !</font><font color="#0000bb">$row </font><font color="#007700">|| </font><font color="#0000bb">$row </font><font color="#007700"><font color="#0000bb">1 </font><font color="#007700">) return </font><font color="#dd0000">' '</font><font color="#007700">;
<br>
<br>    </font><font color="#0000bb">$pages </font><font color="#007700">= </font><font color="#0000bb">$row</font><font color="#007700">;
<br>    </font><font color="#0000bb">$curr_page </font><font color="#007700">= </font><font color="#0000bb">$now </font><font color="#007700">? </font><font color="#0000bb">$now </font><font color="#007700">: </font><font color="#0000bb">1</font><font color="#007700">;
<br>    </font><font color="#0000bb">$offset </font><font color="#007700">= </font><font color="#0000bb">2</font><font color="#007700">;
<br>    </font><font color="#0000bb">$from </font><font color="#007700">= </font><font color="#0000bb">$curr_page </font><font color="#007700">- </font><font color="#0000bb">$offset</font><font color="#007700">;
<br>    </font><font color="#0000bb">$to </font><font color="#007700">= </font><font color="#0000bb">$curr_page </font><font color="#007700">+ </font><font color="#0000bb">$page </font><font color="#007700">- </font><font color="#0000bb">$offset </font><font color="#007700">- </font><font color="#0000bb">1</font><font color="#007700">;
<br>
<br>    if ( </font><font color="#0000bb">$page </font><font color="#007700">> </font><font color="#0000bb">$pages </font><font color="#007700">)
<br>    {
<br>        </font><font color="#0000bb">$from </font><font color="#007700">= </font><font color="#0000bb">1</font><font color="#007700">;
<br>        </font><font color="#0000bb">$to </font><font color="#007700">= </font><font color="#0000bb">$pages</font><font color="#007700">;
<br>    }
<br>    else
<br>    {
<br>        if ( </font><font color="#0000bb">$from </font><font color="#007700"><font color="#0000bb">1</font><font color="#007700">)
<br>        {
<br>            </font><font color="#0000bb">$to </font><font color="#007700">= </font><font color="#0000bb">$curr_page </font><font color="#007700">+ </font><font color="#0000bb">1 </font><font color="#007700">- </font><font color="#0000bb">$from</font><font color="#007700">;
<br>            </font><font color="#0000bb">$from </font><font color="#007700">= </font><font color="#0000bb">1</font><font color="#007700">;
<br>            if ( ( </font><font color="#0000bb">$to </font><font color="#007700">- </font><font color="#0000bb">$from </font><font color="#007700">) <font color="#0000bb">$page </font><font color="#007700">&& ( </font><font color="#0000bb">$to </font><font color="#007700">- </font><font color="#0000bb">$from </font><font color="#007700">) <font color="#0000bb">$pages </font><font color="#007700">)
<br>            {
<br>                </font><font color="#0000bb">$to </font><font color="#007700">= </font><font color="#0000bb">$page</font><font color="#007700">;
<br>            }
<br>        }
<br>        elseif ( </font><font color="#0000bb">$to </font><font color="#007700">> </font><font color="#0000bb">$pages </font><font color="#007700">)
<br>        {
<br>            </font><font color="#0000bb">$from </font><font color="#007700">= </font><font color="#0000bb">$curr_page </font><font color="#007700">- </font><font color="#0000bb">$pages </font><font color="#007700">+ </font><font color="#0000bb">$to</font><font color="#007700">;
<br>            </font><font color="#0000bb">$to </font><font color="#007700">= </font><font color="#0000bb">$pages</font><font color="#007700">;
<br>            if ( ( </font><font color="#0000bb">$to </font><font color="#007700">- </font><font color="#0000bb">$from </font><font color="#007700">) <font color="#0000bb">$page </font><font color="#007700">&& (  </font><font color="#0000bb">$to </font><font color="#007700">- </font><font color="#0000bb">$from</font><font color="#007700">) <font color="#0000bb">$pages </font><font color="#007700">)
<br>            {
<br>                </font><font color="#0000bb">$from </font><font color="#007700">= </font><font color="#0000bb">$pages </font><font color="#007700">- </font><font color="#0000bb">$page </font><font color="#007700">+ </font><font color="#0000bb">1</font><font color="#007700">;
<br>            }
<br>        }
<br>    }
<br>        
<br>    if ( </font><font color="#0000bb">$frist </font><font color="#007700">&& ( </font><font color="#0000bb">$curr_page </font><font color="#007700">- </font><font color="#0000bb">1 </font><font color="#007700">) >= </font><font color="#0000bb">1 </font><font color="#007700">) </font><font color="#0000bb">$p</font><font color="#007700">[</font><font color="#dd0000">'frist'</font><font color="#007700">] = </font><font color="#dd0000">'<a href="'%20</font><font%20color=">. </a></font><font color="#0000bb">$href </font><font color="#007700">. </font><font color="#dd0000">'1">' </font><font color="#007700">. </font><font color="#0000bb">$frist </font><font color="#007700">. </font><font color="#dd0000">''</font><font color="#007700">;
<br>    if ( </font><font color="#0000bb">$prev </font><font color="#007700">&& ( </font><font color="#0000bb">$i </font><font color="#007700">= </font><font color="#0000bb">$curr_page </font><font color="#007700">- </font><font color="#0000bb">1 </font><font color="#007700">) >= </font><font color="#0000bb">1 </font><font color="#007700">) </font><font color="#0000bb">$p</font><font color="#007700">[</font><font color="#dd0000">'prev'</font><font color="#007700">] = </font><font color="#dd0000">'<a href="'%20</font><font%20color=">. </a></font><font color="#0000bb">$href </font><font color="#007700">. </font><font color="#0000bb">$i </font><font color="#007700">. </font><font color="#dd0000">'">' </font><font color="#007700">. </font><font color="#0000bb">$prev </font><font color="#007700">. </font><font color="#dd0000">''</font><font color="#007700">;
<br>    for( </font><font color="#0000bb">$i </font><font color="#007700">= </font><font color="#0000bb">$from</font><font color="#007700">; </font><font color="#0000bb">$i </font><font color="#007700"><font color="#0000bb">$to</font><font color="#007700">; </font><font color="#0000bb">$i </font><font color="#007700">++ )
<br>    {
<br>        if ( </font><font color="#0000bb">$i </font><font color="#007700">== </font><font color="#0000bb">$curr_page </font><font color="#007700">)
<br>        {
<br>            </font><font color="#0000bb">$p</font><font color="#007700">[</font><font color="#0000bb">$i</font><font color="#007700">] = </font><font color="#dd0000">'<a href="'%20</font><font%20color=">. </a></font><font color="#0000bb">$href </font><font color="#007700">. </font><font color="#0000bb">$i </font><font color="#007700">. </font><font color="#dd0000">'" class="nowpage" target="_self">[' </font><font color="#007700">. </font><font color="#0000bb">$i </font><font color="#007700">. </font><font color="#dd0000">']'</font><font color="#007700">;
<br>        }
<br>        else
<br>        {
<br>            </font><font color="#0000bb">$p</font><font color="#007700">[</font><font color="#0000bb">$i</font><font color="#007700">] = </font><font color="#dd0000">'<a href="'%20</font><font%20color=">. </a></font><font color="#0000bb">$href </font><font color="#007700">. </font><font color="#0000bb">$i </font><font color="#007700">. </font><font color="#dd0000">'" target="_self">' </font><font color="#007700">. </font><font color="#0000bb">$i </font><font color="#007700">. </font><font color="#dd0000">''</font><font color="#007700">;
<br>        }
<br>    }
<br>    if ( </font><font color="#0000bb">$next </font><font color="#007700">&& ( </font><font color="#0000bb">$i </font><font color="#007700">= </font><font color="#0000bb">$curr_page </font><font color="#007700">+ </font><font color="#0000bb">1 </font><font color="#007700">) <font color="#0000bb">$pages </font><font color="#007700">) </font><font color="#0000bb">$p</font><font color="#007700">[</font><font color="#dd0000">'next'</font><font color="#007700">] = </font><font color="#dd0000">'<a href="'%20</font><font%20color=">. </a></font><font color="#0000bb">$href </font><font color="#007700">. </font><font color="#0000bb">$i </font><font color="#007700">. </font><font color="#dd0000">'" target="_self">' </font><font color="#007700">. </font><font color="#0000bb">$next </font><font color="#007700">. </font><font color="#dd0000">''</font><font color="#007700">;
<br>    if ( </font><font color="#0000bb">$last </font><font color="#007700">&& ( </font><font color="#0000bb">$curr_page </font><font color="#007700">+ </font><font color="#0000bb">1 </font><font color="#007700">) <font color="#0000bb">$pages </font><font color="#007700">) </font><font color="#0000bb">$p</font><font color="#007700">[</font><font color="#dd0000">'last'</font><font color="#007700">] = </font><font color="#dd0000">'<a href="'%20</font><font%20color=">. </a></font><font color="#0000bb">$href </font><font color="#007700">. </font><font color="#0000bb">$pages </font><font color="#007700">. </font><font color="#dd0000">'" target="_self">' </font><font color="#007700">. </font><font color="#0000bb">$last </font><font color="#007700">. </font><font color="#dd0000">''</font><font color="#007700">;
<br>
<br>    return </font><font color="#0000bb">implode</font><font color="#007700">( </font><font color="#0000bb">$space</font><font color="#007700">, </font><font color="#0000bb">$p </font><font color="#007700">);
<br>} </font><font color="#ff8000">// end func<br></font><font color="#0000bb"></font>
</font>
</font></font></font></font></font></font></font></font></font></code><hr>
Nach dem Login kopieren


将上面的代码命名为"function.page.php"保存到Smarty的plugins目录里

<font size="2"><font face="verdana,arial,helvetica">代码:</font><hr></font>



<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">


{page row=10}
{page row=10 now=5}
{page row=10 now=5 href="plugins.php?a=1&b=2&page=" frist="第一页" prev="上一页" next="下一页" last="最后页"}
{page row=10 now=5 href="plugins.php?a=1&b=2&page=" frist="第一页" prev="上一页" next="下一页" last="最后页"}
{page row=10 now=1 href="plugins.php?a=1&b=2&page=" frist="第一页" prev="上一页" next="下一页" last="最后页"}
{page row=10 now=10 href="plugins.php?a=1&b=2&page=" frist="第一页" prev="上一页" next="下一页" last="最后页"}


<hr>
Nach dem Login kopieren


将上面的代码命名为"plugins.html"保存到Smarty的template目录里

2、测试程序
<font size="2"><font face="verdana,arial,helvetica">PHP代码:</font><hr></font><code><font color="#000000">
<font color="#0000bb"><br>$Smarty</font><font color="#007700">-></font><font color="#0000bb">display</font><font color="#007700">( </font><font color="#dd0000">'plugins.html' </font><font color="#007700">);<br></font><font color="#0000bb"></font>
</font>
</code><hr>
Nach dem Login kopieren



3、使用说明
我懒得打了,对比一下"plugins.html"的5个{page}用法,以及看看显示出来的效果就明白是什么了

4、插件说明
“《Smarty手册》第十六章.以插件扩展Smarty ”的应用。像中文字符截取之类的都可以以plugins扩展Smarty,Smarty自带的截取不支持中文。

二、Smarty自动生成静态页面
如果你的文件扩展名为".html"~~~~~嘿嘿,这不就是静态页面了吗?-_-!

至于怎么取得静态的文件名呢?

<font size="2"><font face="verdana,arial,helvetica">PHP代码:</font><hr></font><code><font color="#000000">
<font color="#0000bb"><br></font><font color="#ff8000">/**
<br> *
<br> */
<br></font><font color="#007700">class </font><font color="#0000bb">template </font><font color="#007700">extends </font><font color="#0000bb">Smarty
<br></font><font color="#007700">{
<br>    
<br>    </font><font color="#ff8000">/**
<br>     *
<br>    */
<br>    </font><font color="#007700">function </font><font color="#0000bb">template </font><font color="#007700">()
<br>    {
<br>        </font><font color="#0000bb">$this</font><font color="#007700">-></font><font color="#0000bb">Smarty</font><font color="#007700">();
<br>    } </font><font color="#ff8000">// end func
<br>    
<br>    /**
<br>     *
<br>    */
<br>    </font><font color="#007700">function </font><font color="#0000bb">name </font><font color="#007700">( </font><font color="#0000bb">$tpl_file</font><font color="#007700">, </font><font color="#0000bb">$cache_id </font><font color="#007700">= </font><font color="#0000bb">null</font><font color="#007700">, </font><font color="#0000bb">$compile_id </font><font color="#007700">= </font><font color="#0000bb">null </font><font color="#007700">)
<br>    {
<br>        
<br>        if (!isset(</font><font color="#0000bb">$compile_id</font><font color="#007700">)) </font><font color="#0000bb">$compile_id </font><font color="#007700">= </font><font color="#0000bb">$this</font><font color="#007700">-></font><font color="#0000bb">compile_id</font><font color="#007700">;
<br>
<br>        </font><font color="#0000bb">$_auto_id </font><font color="#007700">= </font><font color="#0000bb">$this</font><font color="#007700">-></font><font color="#0000bb">_get_auto_id</font><font color="#007700">( </font><font color="#0000bb">$cache_id</font><font color="#007700">, </font><font color="#0000bb">$compile_id </font><font color="#007700">);
<br>        </font><font color="#0000bb">$_cache_file </font><font color="#007700">= </font><font color="#0000bb">$this</font><font color="#007700">-></font><font color="#0000bb">_get_auto_filename</font><font color="#007700">( </font><font color="#0000bb">$this</font><font color="#007700">-></font><font color="#0000bb">cache_dir</font><font color="#007700">, </font><font color="#0000bb">$tpl_file</font><font color="#007700">, </font><font color="#0000bb">$_auto_id </font><font color="#007700">);
<br>
<br>        return </font><font color="#0000bb">basename</font><font color="#007700">( </font><font color="#0000bb">$_cache_file </font><font color="#007700">);
<br>    } </font><font color="#ff8000">// end func
<br></font><font color="#007700">} </font><font color="#ff8000">// end class
<br>
<br></font><font color="#0000bb">$Smarty        </font><font color="#007700">= new </font><font color="#0000bb">template</font><font color="#007700">;
<br></font><font color="#0000bb">$file_name    </font><font color="#007700">= </font><font color="#0000bb">$Smarty</font><font color="#007700">-></font><font color="#0000bb">name</font><font color="#007700">( </font><font color="#dd0000">'plugins.html'</font><font color="#007700">, </font><font color="#dd0000">'cache_name' </font><font color="#007700">);</font><font color="#ff8000">#html文件的名字(不包含路径)
<br>
<br></font><font color="#0000bb">$Smarty</font><font color="#007700">-></font><font color="#0000bb">cache_lifetime    </font><font color="#007700">= -</font><font color="#0000bb">1</font><font color="#007700">;</font><font color="#ff8000">#静态文件永不过期
<br></font><font color="#0000bb">$Smarty</font><font color="#007700">-></font><font color="#0000bb">fetch</font><font color="#007700">( </font><font color="#dd0000">'plugins.html'</font><font color="#007700">, </font><font color="#dd0000">'cache_name' </font><font color="#007700">);</font><font color="#ff8000">#生成静态html文件<br></font><font color="#0000bb"></font>
</font>
</code><hr>
Nach dem Login kopieren


Smarty的功能很多很多(使用了半年,深有体会),还有待大家继续发掘。。。。

Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Heiße KI -Werkzeuge

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Clothoff.io

Clothoff.io

KI-Kleiderentferner

AI Hentai Generator

AI Hentai Generator

Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)
3 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Beste grafische Einstellungen
3 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. So reparieren Sie Audio, wenn Sie niemanden hören können
3 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌

Heiße Werkzeuge

Notepad++7.3.1

Notepad++7.3.1

Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version

SublimeText3 chinesische Version

Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1

Senden Sie Studio 13.0.1

Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6

Dreamweaver CS6

Visuelle Webentwicklungstools

SublimeText3 Mac-Version

SublimeText3 Mac-Version

Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Was bedeuten src und href? Was bedeuten src und href? Aug 16, 2023 pm 05:00 PM

src und href sind jeweils 1. src ist die Abkürzung für Quelle, die zur Angabe des Pfads externer Ressourcen verwendet wird. Es wird normalerweise zum Einbetten externer Dateien wie Bilder, Audios, Videos usw. verwendet. Das src-Attribut ist im Allgemeinen wird für img, script, iframe und andere Tags verwendet. 2. href ist die Abkürzung für Hypertext-Referenz, die verwendet wird, um den Pfad der Zielressource des Hyperlinks anzugeben. Das href-Attribut wird im Allgemeinen für Tags wie a und link verwendet.

So implementieren Sie Daten-Paging und Anzeigeoptimierung in Vue-Projekten So implementieren Sie Daten-Paging und Anzeigeoptimierung in Vue-Projekten Oct 15, 2023 am 09:27 AM

Implementieren von Daten-Paging und Anzeigeoptimierung in Vue-Projekten: Wenn eine Seite eine große Datenmenge anzeigen muss, muss in der Regel eine Daten-Paging- und Anzeigeoptimierung durchgeführt werden, um die Benutzererfahrung zu verbessern Implementieren Sie Daten-Paging und Anzeigeoptimierung und stellen Sie spezifische Codebeispiele bereit. 1. Daten-Paging Unter Daten-Paging versteht man die Aufteilung einer großen Datenmenge auf mehrere Seiten nach bestimmten Regeln und deren Anzeige auf der Seite. Mit den folgenden Schritten können Sie Daten-Paging in einem Vue-Projekt implementieren: Definieren Sie die Datenquelle. Definieren Sie zunächst eine Datenquelle, die alle Daten enthält.

Was sind die Unterschiede in Funktion und Verwendung zwischen dem src-Attribut und dem href-Attribut? Was sind die Unterschiede in Funktion und Verwendung zwischen dem src-Attribut und dem href-Attribut? Dec 28, 2023 am 08:20 AM

Das src-Attribut und das href-Attribut sind häufig verwendete Attribute in HTML und werden zum Laden externer Ressourcen verwendet. Obwohl sie ähnliche Zwecke verfolgen, gibt es einige Unterschiede in der Verwendung und dem Zweck. src-Attribut: Das src-Attribut wird verwendet, um externe Ressourcen anzugeben, die in das Dokument eingebettet werden sollen. Es wird hauptsächlich zum Einfügen externer Skriptdateien und Mediendateien in HTML-Dokumente verwendet. Es kann in den folgenden Situationen verwendet werden: Externe JavaScript-Dateien einführen: Verknüpfen Sie externe JavaScript-Dateien über das src-Attribut mit HTML-Seiten.

Eine vorläufige Studie zu Smarty, der Template-Engine in PHP Eine vorläufige Studie zu Smarty, der Template-Engine in PHP May 11, 2023 pm 05:15 PM

Heutzutage ist die Website-Entwicklung untrennbar mit einer wichtigen Komponenten-Template-Engine verbunden. Eine Template-Engine bezieht sich auf ein Tool, das Seitenvorlagen und Daten kombiniert, um HTML-Code mit einem bestimmten Format zu generieren. In verschiedenen Website-Entwicklungsframeworks ist die Template-Engine eine wesentliche Komponente, da die Template-Engine die Duplizierung von Code erheblich reduzieren und die Dynamik der Seite verbessern kann. Eine der gebräuchlichsten und beliebtesten Template-Engines ist Smarty. Smarty ist ein DSL (DomainSpecif

So verwenden Sie PHP und Smarty, um eine Front-End- und Back-End-Trennentwicklung zu erreichen So verwenden Sie PHP und Smarty, um eine Front-End- und Back-End-Trennentwicklung zu erreichen Jun 25, 2023 pm 01:46 PM

In der modernen Webentwicklung ist die Trennung von Front-End und Back-End zu einem sehr beliebten Trend geworden, der es Entwicklern ermöglicht, Projekte besser zu organisieren und die Effizienz der Projektentwicklung zu verbessern. PHP und Smarty sind zwei sehr häufig verwendete Technologien, mit denen eine Front-End- und Back-End-Trennungsentwicklung erreicht werden kann. In diesem Artikel wird erläutert, wie Sie mit PHP und Smarty eine Front-End- und Back-End-Trennungsentwicklung erreichen. Was ist Front-End- und Back-End-Trennung? Bei der traditionellen Webentwicklung ist das Front-End hauptsächlich für die Darstellung der Seite und die Logik der Interaktion mit dem Back-End verantwortlich. Das Backend ist hauptsächlich für das Geschäft verantwortlich

Welche Anfrage wird von href und src gesendet? Welche Anfrage wird von href und src gesendet? Aug 17, 2023 pm 02:20 PM

Erhalten Sie von href und src gesendete Anfragen. Detaillierte Beschreibung: 1. Das href-Attribut wird verwendet, um die Zielressource des Links anzugeben. Beim Verweisen auf ein externes Stylesheet wird eine GET-Anfrage gesendet, um die CSS-Datei abzurufen Beim Verweisen auf ein Bild wird eine GET-Anfrage gesendet. Um die angegebene Bilddatei abzurufen, wird das src-Attribut verwendet, um die URL der eingebetteten Ressource anzugeben GET-Anfrage zum Abrufen der angegebenen Bilddatei Beim Verweisen auf das Audio wird eine GET-Anfrage gesendet, um die angegebene Audiodatei usw. abzurufen.

Sie können die Zieltabelle „table_name' für die Aktualisierung nicht in der FROM-Klausel angeben – So beheben Sie den MySQL-Fehler: Die Zieltabelle kann in der FROM-Klausel nicht aktualisiert werden Sie können die Zieltabelle „table_name' für die Aktualisierung nicht in der FROM-Klausel angeben – So beheben Sie den MySQL-Fehler: Die Zieltabelle kann in der FROM-Klausel nicht aktualisiert werden Oct 05, 2023 am 10:25 AM

Hallo, es folgt ein Artikel mit 1500 Wörtern und dem Titel: Youcan'tspecifytargettable'table_name'forupdateinFROMclause – So beheben Sie den MySQL-Fehler: Die Zieltabelle kann in der FROM-Klausel nicht aktualisiert werden. Es sind spezifische Codebeispiele erforderlich. Während der Entwicklung einer MySQL-Datenbank stoßen wir manchmal auf die folgende Fehlermeldung: Youcan'tspecify

Erfahren Sie die wichtigen Details zum Unterschied zwischen src und href! Erfahren Sie die wichtigen Details zum Unterschied zwischen src und href! Jan 06, 2024 am 09:11 AM

Der Unterschied zwischen src und href, Details, die Sie kennen müssen! Beim Schreiben von HTML-Seiten stoßen wir häufig auf die beiden Attribute src und href. Sie alle werden verwendet, um auf externe Ressourcen wie Skriptdateien, Stildateien oder Bilder zu verweisen. Obwohl ihre Zwecke ähnlich sind, gibt es einige Unterschiede in ihrer spezifischen Verwendung und ihren Details. Zunächst wird das src-Attribut (Quelle) hauptsächlich zum Einbetten externer Ressourcen wie Bilder oder Skripte verwendet. Es wird verwendet, um die Adresse einer Ressource anzugeben und ihren Inhalt in das aktuelle Dokument einzubetten. Und href(

See all articles