Heim PHP-Framework Laravel Laravel-Entwicklung: Wie verwende ich das Laravel Blade-Vorlagenlayout?

Laravel-Entwicklung: Wie verwende ich das Laravel Blade-Vorlagenlayout?

Jun 14, 2023 am 10:41 AM
laravel blade 模板布局

Laravel ist ein ausgezeichnetes Entwicklungsframework, das auf PHP basiert. Es hat den Vorteil, dass es einfach zu erlernen, effizient und sicher ist und bei WEB-Entwicklern sehr beliebt ist. Unter anderem ist das Laravel Blade-Vorlagenlayout eine sehr praktische Funktion im Laravel-Framework. In diesem Artikel erfahren Sie, wie Sie das Laravel Blade-Vorlagenlayout anhand tatsächlicher Fälle verwenden.

Was ist das Blade-Vorlagenlayout?

Blade-Vorlagen-Engine ist die Standard-Ansichts-Engine des Laravel-Frameworks. Im Vergleich zur Template-Engine der nativen PHP-Syntax unterstützt Blade eine prägnantere und elegantere Syntax und kann besser mit dem Laravel-Framework verwendet werden. Das Layout der Laravel Blade-Vorlage bezieht sich auf die Aufteilung der Webseite in eine modulare Kombination aus Header, Tail, Sidebar und Blockinhalten, um die separate Entwicklung zu erleichtern und die Entwicklungseffizienz zu verbessern.

  1. Erstellen Sie die Layout-Master-Vorlage

In Laravel können wir den Befehl artisan verwenden, um die Layout-Master-Vorlage zu generieren. Die spezifischen Schritte sind wie folgt:

php artisan make:layout masterphp artisan make:layout master

执行该命令后,在项目resources/views/layouts/目录下会生成一个名为master.blade.php的主模板文件。打开该文件,可以看到其中的代码内容如下:

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>@yield('title')</title>
</head>
<body>
    <header>
        @yield('header')
    </header>
    <nav>
        @yield('nav')
    </nav>
    <main>
        @yield('content')
    </main>
    <footer>
        @yield('footer')
    </footer>
</body>
</html>
Nach dem Login kopieren

我们可以看到,模板文件中包含了头部、尾部、导航栏、主体等不同的区块,使用Blade模板语法的@yield()函数来占位,这里的@yield()函数定义了一个模板区块,以后我们将在其他视图文件中使用@section()函数填充这些模板区块。

  1. 替换被继承的子视图

对于任何需要使用布局的视图文件,都可以通过继承主模板来进行布局。打开视图文件,添加如下代码:

@extends('layouts.master')

Nach der Ausführung dieses Befehls wird eine Master-Vorlagendatei mit dem Namen master.blade.php im Verzeichnis resources/views/layouts/ des Projekts generiert. Öffnen Sie die Datei und Sie können sehen, dass der Codeinhalt wie folgt lautet:

@section('title', '页面标题')
@section('header')
    <h1>头部内容</h1>
@endsection
@section('nav')
    <ul>
        <li><a href="#">导航栏1</a></li>
        <li><a href="#">导航栏2</a></li>
        <li><a href="#">导航栏3</a></li>
    </ul>
@endsection
@section('content')
    <p>主体内容</p>
@endsection
@section('footer')
    <p>版权信息</p>
@endsection
Nach dem Login kopieren

Wir können sehen, dass die Vorlagendatei verschiedene Blöcke wie Header, Tail, Navigationsleiste, Body usw. enthält, indem wir @yield() der Blade-Vorlage verwenden Die Funktion @yield() definiert hier einen Vorlagenblock. Wir werden in Zukunft die Funktion @section() in anderen Ansichtsdateien verwenden.

    Geerbte Unteransichten ersetzen
    1. Für jede Ansichtsdatei, die ein Layout verwenden muss, können Sie das Layout erstellen, indem Sie die Hauptvorlage erben. Öffnen Sie die Ansichtsdatei und fügen Sie den folgenden Code hinzu:

    @extends('layouts.master')

    @extends('layouts.master') bedeutet hier, dass die aktuelle Ansichtsdatei von der Hauptansicht erbt Vorlagendatei layouts.master . Als Nächstes können Sie diese Vorlagenblöcke mit den durch die Funktion @yield() definierten Vorlagenblocknamen füllen. Sie können der Ansichtsdatei beispielsweise den folgenden Code hinzufügen:

        <?php
    
        namespace AppHttpControllers;
    
        use IlluminateHttpRequest;
        use IlluminateSupportFacadesView;
    
        class HomeController extends Controller
        {
            public function index()
            {
                $data = [
                    'title' => '页面标题',
                    'header' => '<h1>头部内容</h1>',
                    'nav' => '<ul>
                                <li><a href="#">导航栏1</a></li>
                                <li><a href="#">导航栏2</a></li>
                                <li><a href="#">导航栏3</a></li>
                              </ul>',
                    'content' => '<p>主体内容</p>',
                    'footer' => '<p>版权信息</p>'
                ];
                return View::make('home.index', $data);
            }
        }
    Nach dem Login kopieren
      Im obigen Code die Funktion @section() Verwendet Zum Ausfüllen von Vorlagenabschnitten in der Hauptvorlage wird beispielsweise @section('title', 'page title') zum Ausfüllen des -Tags verwendet. Im Gegensatz zu Standard-HTML-Vorlagen, die Variablen zum Füllen verwenden, ermöglichen uns Blade-Vorlagen, einen Teil des Inhalts anderer Vorlagen zu erben und die Trennung von Daten deutlicher zu machen. <li></li></ol>Verwenden Sie statische Methoden von Laravel View<p></p><p>Zusätzlich zu den Funktionen @yield() und @section() bietet Laravel auch statische View-Methoden. Die spezifischen Implementierungsschritte lauten wie folgt: </p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'>@section('content') <div> @foreach ($posts as $post) <h2>{{ $post->title }}</h2> <p>{{ substr($post->content, 0, 100) }}</p> @endforeach </div> @endsection</pre><div class="contentsignin">Nach dem Login kopieren</div></div><p>Im obigen Code haben wir View::make verwendet, um die Ansicht zu generieren, und eine Array-Instanz $data als Variablenkontext der Ansicht übergeben. In diesem Array definieren wir fünf Variablen, darunter $title, $header, $nav, $content und $footer, die zum Ausfüllen der entsprechenden Vorlagenblöcke in der Hauptvorlage verwendet werden. </p> <p></p>Verwenden Sie Kontrollstrukturen in Blade-Vorlagen🎜🎜🎜In Blade-Vorlagen können wir zusätzlich zu @yield() und @section() zum Füllen von Vorlagenblöcken auch Kontrollstrukturen wie @if, @foreach, @for verwenden usw. Um eine bestimmte Logik zu implementieren, lautet die spezifische Implementierung wie folgt: 🎜rrreee🎜In diesem Code verwenden wir die @foreach-Schleifenanweisung, um das Array $posts zu durchlaufen, und verwenden {{ $post->title }} und {{ substr($post ->content, 0, 100) }} zur Ausgabe des Artikeltitels und des kurzen Inhalts. 🎜🎜Zusammenfassung🎜🎜Das Obige ist eine praktische Falldemonstration der Verwendung des Laravel Blade-Vorlagenlayouts. Die Verwendung des Laravel Blade-Vorlagenlayouts kann die Entwicklungseffizienz von WEB-Anwendungen erheblich verbessern und gleichzeitig die Trennung ermöglichen Geschäftslogik und Ansichten offensichtlicher. Darüber hinaus verfügt das Laravel-Framework natürlich über viele leistungsstarke Funktionen, die es wert sind, erkundet zu werden. 🎜<p>Das obige ist der detaillierte Inhalt vonLaravel-Entwicklung: Wie verwende ich das Laravel Blade-Vorlagenlayout?. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!</p> </div> </div> <div class="wzconShengming_sp"> <div class="bzsmdiv_sp">Erklärung dieser Website</div> <div>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</div> </div> </div> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="2507867629"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <div class="AI_ToolDetails_main4sR"> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5902227090019525" data-ad-slot="3653428331" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>Heißer Artikel</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796785841.html" title="Assassin's Creed Shadows: Seashell Riddle -Lösung" class="phpgenera_Details_mainR4_bottom_title">Assassin's Creed Shadows: Seashell Riddle -Lösung</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796789525.html" title="Was ist neu in Windows 11 KB5054979 und wie Sie Update -Probleme beheben" class="phpgenera_Details_mainR4_bottom_title">Was ist neu in Windows 11 KB5054979 und wie Sie Update -Probleme beheben</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796785857.html" title="Wo kann man die Kransteuerungsschlüsselkarten in Atomfall finden" class="phpgenera_Details_mainR4_bottom_title">Wo kann man die Kransteuerungsschlüsselkarten in Atomfall finden</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796784440.html" title="<🎜>: Dead Rails - wie man jede Herausforderung abschließt" class="phpgenera_Details_mainR4_bottom_title"><🎜>: Dead Rails - wie man jede Herausforderung abschließt</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>4 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796784000.html" title="Atomfall Guide: Gegenstandsstandorte, Questführer und Tipps" class="phpgenera_Details_mainR4_bottom_title">Atomfall Guide: Gegenstandsstandorte, Questführer und Tipps</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 Monate vor</span> <span>By DDD</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/de/article.html">Mehr anzeigen</a> </div> </div> </div> --> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>Heiße KI -Werkzeuge</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title"> <h3>Undresser.AI Undress</h3> </a> <p>KI-gestützte App zum Erstellen realistischer Aktfotos</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title"> <h3>AI Clothes Remover</h3> </a> <p>Online-KI-Tool zum Entfernen von Kleidung aus Fotos.</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title"> <h3>Undress AI Tool</h3> </a> <p>Ausziehbilder kostenlos</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title"> <h3>Clothoff.io</h3> </a> <p>KI-Kleiderentferner</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/ai/video-swap" title="Video Face Swap" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173414504068133.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Video Face Swap" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/ai/video-swap" title="Video Face Swap" class="phpmain_tab2_mids_title"> <h3>Video Face Swap</h3> </a> <p>Tauschen Sie Gesichter in jedem Video mühelos mit unserem völlig kostenlosen KI-Gesichtstausch-Tool aus!</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/de/ai">Mehr anzeigen</a> </div> </div> </div> <script src="https://sw.php.cn/hezuo/cac1399ab368127f9b113b14eb3316d0.js" type="text/javascript"></script> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>Heißer Artikel</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796785841.html" title="Assassin's Creed Shadows: Seashell Riddle -Lösung" class="phpgenera_Details_mainR4_bottom_title">Assassin's Creed Shadows: Seashell Riddle -Lösung</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796789525.html" title="Was ist neu in Windows 11 KB5054979 und wie Sie Update -Probleme beheben" class="phpgenera_Details_mainR4_bottom_title">Was ist neu in Windows 11 KB5054979 und wie Sie Update -Probleme beheben</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796785857.html" title="Wo kann man die Kransteuerungsschlüsselkarten in Atomfall finden" class="phpgenera_Details_mainR4_bottom_title">Wo kann man die Kransteuerungsschlüsselkarten in Atomfall finden</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796784440.html" title="<🎜>: Dead Rails - wie man jede Herausforderung abschließt" class="phpgenera_Details_mainR4_bottom_title"><🎜>: Dead Rails - wie man jede Herausforderung abschließt</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>4 Wochen vor</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/1796784000.html" title="Atomfall Guide: Gegenstandsstandorte, Questführer und Tipps" class="phpgenera_Details_mainR4_bottom_title">Atomfall Guide: Gegenstandsstandorte, Questführer und Tipps</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 Monate vor</span> <span>By DDD</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/de/article.html">Mehr anzeigen</a> </div> </div> </div> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>Heiße Werkzeuge</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/toolset/development-tools/92" title="Notepad++7.3.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Notepad++7.3.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/toolset/development-tools/92" title="Notepad++7.3.1" class="phpmain_tab2_mids_title"> <h3>Notepad++7.3.1</h3> </a> <p>Einfach zu bedienender und kostenloser Code-Editor</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/toolset/development-tools/93" title="SublimeText3 chinesische Version" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 chinesische Version" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/toolset/development-tools/93" title="SublimeText3 chinesische Version" class="phpmain_tab2_mids_title"> <h3>SublimeText3 chinesische Version</h3> </a> <p>Chinesische Version, sehr einfach zu bedienen</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/toolset/development-tools/121" title="Senden Sie Studio 13.0.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Senden Sie Studio 13.0.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/toolset/development-tools/121" title="Senden Sie Studio 13.0.1" class="phpmain_tab2_mids_title"> <h3>Senden Sie Studio 13.0.1</h3> </a> <p>Leistungsstarke integrierte PHP-Entwicklungsumgebung</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Dreamweaver CS6" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_title"> <h3>Dreamweaver CS6</h3> </a> <p>Visuelle Webentwicklungstools</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/de/toolset/development-tools/500" title="SublimeText3 Mac-Version" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac-Version" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/de/toolset/development-tools/500" title="SublimeText3 Mac-Version" class="phpmain_tab2_mids_title"> <h3>SublimeText3 Mac-Version</h3> </a> <p>Codebearbeitungssoftware auf Gottesniveau (SublimeText3)</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/de/ai">Mehr anzeigen</a> </div> </div> </div> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>Heiße Themen</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/gmailyxdlrkzn" title="Wo ist der Login-Zugang für Gmail-E-Mail?" class="phpgenera_Details_mainR4_bottom_title">Wo ist der Login-Zugang für Gmail-E-Mail?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>7677</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>15</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/cakephp-tutor" title="CakePHP-Tutorial" class="phpgenera_Details_mainR4_bottom_title">CakePHP-Tutorial</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>1393</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>52</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/c-tutorial" title="C#-Tutorial" class="phpgenera_Details_mainR4_bottom_title">C#-Tutorial</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>1207</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>24</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/steamdzhmcssmgs" title="Wie lautet das Format des Kontonamens von Steam?" class="phpgenera_Details_mainR4_bottom_title">Wie lautet das Format des Kontonamens von Steam?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>91</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>11</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/de/faq/winactivationkeyper" title="Win11 -Aktivierungsschlüssel dauerhaft" class="phpgenera_Details_mainR4_bottom_title">Win11 -Aktivierungsschlüssel dauerhaft</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>73</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>19</span> </div> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/de/faq/zt">Mehr anzeigen</a> </div> </div> </div> </div> </div> <div class="Article_Details_main2"> <div class="phpgenera_Details_mainL4"> <div class="phpmain1_2_top"> <a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img src="/static/imghw/index2_title2.png" alt="" /></a> </div> <div class="phpgenera_Details_mainL4_info"> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796787527.html" title="Wie bekomme ich den Rückgabecode, wenn das Senden von E -Mails in Laravel fehlschlägt?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/246/273/174277573987100.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Wie bekomme ich den Rückgabecode, wenn das Senden von E -Mails in Laravel fehlschlägt?" /> </a> <a href="https://www.php.cn/de/faq/1796787527.html" title="Wie bekomme ich den Rückgabecode, wenn das Senden von E -Mails in Laravel fehlschlägt?" class="phphistorical_Version2_mids_title">Wie bekomme ich den Rückgabecode, wenn das Senden von E -Mails in Laravel fehlschlägt?</a> <span class="Articlelist_txts_time">Apr 01, 2025 pm 02:45 PM</span> <p class="Articlelist_txts_p">Methode zum Abholen des Rücksendecode, wenn das Senden von Laravel -E -Mails fehlschlägt. Wenn Sie Laravel zur Entwicklung von Anwendungen verwenden, stellen Sie häufig Situationen auf, in denen Sie Überprüfungscodes senden müssen. Und in Wirklichkeit ...</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796786978.html" title="Laravel -Zeitplanaufgabe wird nicht ausgeführt: Was soll ich tun, wenn die Aufgabe nicht nach Zeitplan ausgeführt wird: Befehl ausführen?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/246/273/174312396549315.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Laravel -Zeitplanaufgabe wird nicht ausgeführt: Was soll ich tun, wenn die Aufgabe nicht nach Zeitplan ausgeführt wird: Befehl ausführen?" /> </a> <a href="https://www.php.cn/de/faq/1796786978.html" title="Laravel -Zeitplanaufgabe wird nicht ausgeführt: Was soll ich tun, wenn die Aufgabe nicht nach Zeitplan ausgeführt wird: Befehl ausführen?" class="phphistorical_Version2_mids_title">Laravel -Zeitplanaufgabe wird nicht ausgeführt: Was soll ich tun, wenn die Aufgabe nicht nach Zeitplan ausgeführt wird: Befehl ausführen?</a> <span class="Articlelist_txts_time">Mar 31, 2025 pm 11:24 PM</span> <p class="Articlelist_txts_p">Laravel -Zeitplan -Aufgabe Ausführen nicht reagierende Fehlerbehebung Bei Verwendung der Zeitplanung von Laravel -Zeitplänen werden viele Entwickler auf dieses Problem stoßen: Zeitplan: Run ...</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796786986.html" title="Wie kann man in Laravel mit der Situation umgehen, in der Überprüfungscodes nicht per E -Mail gesendet werden?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/246/273/174304094696600.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Wie kann man in Laravel mit der Situation umgehen, in der Überprüfungscodes nicht per E -Mail gesendet werden?" /> </a> <a href="https://www.php.cn/de/faq/1796786986.html" title="Wie kann man in Laravel mit der Situation umgehen, in der Überprüfungscodes nicht per E -Mail gesendet werden?" class="phphistorical_Version2_mids_title">Wie kann man in Laravel mit der Situation umgehen, in der Überprüfungscodes nicht per E -Mail gesendet werden?</a> <span class="Articlelist_txts_time">Mar 31, 2025 pm 11:48 PM</span> <p class="Articlelist_txts_p">Die Methode zum Umgang mit Laravels E -Mail -Versagen zum Senden von Verifizierungscode besteht darin, Laravel zu verwenden ...</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796787273.html" title="So implementieren Sie die benutzerdefinierte Tabellenfunktion des Klickens, um Daten im DCAT -Administrator hinzuzufügen?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/246/273/174303733844117.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="So implementieren Sie die benutzerdefinierte Tabellenfunktion des Klickens, um Daten im DCAT -Administrator hinzuzufügen?" /> </a> <a href="https://www.php.cn/de/faq/1796787273.html" title="So implementieren Sie die benutzerdefinierte Tabellenfunktion des Klickens, um Daten im DCAT -Administrator hinzuzufügen?" class="phphistorical_Version2_mids_title">So implementieren Sie die benutzerdefinierte Tabellenfunktion des Klickens, um Daten im DCAT -Administrator hinzuzufügen?</a> <span class="Articlelist_txts_time">Apr 01, 2025 am 07:09 AM</span> <p class="Articlelist_txts_p">So implementieren Sie die Tabellenfunktion von benutzerdefiniertem Klicken, um Daten in dcatadmin (laravel-admin) hinzuzufügen, wenn Sie DCAT verwenden ...</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796587899.html" title="Laravel – Dump-Server" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202408/27/2024082710513986124.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Laravel – Dump-Server" /> </a> <a href="https://www.php.cn/de/faq/1796587899.html" title="Laravel – Dump-Server" class="phphistorical_Version2_mids_title">Laravel – Dump-Server</a> <span class="Articlelist_txts_time">Aug 27, 2024 am 10:51 AM</span> <p class="Articlelist_txts_p">Laravel – Dump-Server – Der Laravel-Dump-Server wird mit der Version von Laravel 5.7 geliefert. Die Vorgängerversionen enthalten keinen Dump-Server. Der Dump-Server wird eine Entwicklungsabhängigkeit in der Laravel-/Laravel-Composer-Datei sein.</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796787285.html" title="Laravel Redis -Verbindungsfreigabe: Warum wirkt sich die Auswahlmethode auf andere Verbindungen aus?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/246/273/174303424249248.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Laravel Redis -Verbindungsfreigabe: Warum wirkt sich die Auswahlmethode auf andere Verbindungen aus?" /> </a> <a href="https://www.php.cn/de/faq/1796787285.html" title="Laravel Redis -Verbindungsfreigabe: Warum wirkt sich die Auswahlmethode auf andere Verbindungen aus?" class="phphistorical_Version2_mids_title">Laravel Redis -Verbindungsfreigabe: Warum wirkt sich die Auswahlmethode auf andere Verbindungen aus?</a> <span class="Articlelist_txts_time">Apr 01, 2025 am 07:45 AM</span> <p class="Articlelist_txts_p">Die Auswirkungen des Austauschs von Redis -Verbindungen im Laravel -Framework und der Auswahl von Methoden bei Verwendung von Laravel -Framework und Redis können Entwickler auf ein Problem stoßen: Durch Konfiguration ...</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796787320.html" title="Laravel Multi-Tenant-Erweiterungsstanz/Mietverhältnis: Wie passen Sie die Host-Adresse einer Mieterdatenbankverbindung an?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/001/246/273/174295045413017.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Laravel Multi-Tenant-Erweiterungsstanz/Mietverhältnis: Wie passen Sie die Host-Adresse einer Mieterdatenbankverbindung an?" /> </a> <a href="https://www.php.cn/de/faq/1796787320.html" title="Laravel Multi-Tenant-Erweiterungsstanz/Mietverhältnis: Wie passen Sie die Host-Adresse einer Mieterdatenbankverbindung an?" class="phphistorical_Version2_mids_title">Laravel Multi-Tenant-Erweiterungsstanz/Mietverhältnis: Wie passen Sie die Host-Adresse einer Mieterdatenbankverbindung an?</a> <span class="Articlelist_txts_time">Apr 01, 2025 am 09:09 AM</span> <p class="Articlelist_txts_p">Benutzerdefinierte Mieterdatenbankverbindung in Laravel Multi-Tenant-Erweiterungspaket Stanz/Mietverhältnis beim Erstellen von Multi-Mandanten-Anwendungen mit Laravel Multi-Tenant-Erweiterungspaket Stanz/Mietverhältnis, ...</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/de/faq/1796587900.html" title="Laravel – Aktions-URL" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/202408/27/2024082710514290980.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Laravel – Aktions-URL" /> </a> <a href="https://www.php.cn/de/faq/1796587900.html" title="Laravel – Aktions-URL" class="phphistorical_Version2_mids_title">Laravel – Aktions-URL</a> <span class="Articlelist_txts_time">Aug 27, 2024 am 10:51 AM</span> <p class="Articlelist_txts_p">Laravel – Aktions-URL – Laravel 5.7 führt eine neue Funktion namens „Aufrufbare Aktions-URL“ ein. Diese Funktion ähnelt der in Laravel 5.6, die String-in-Action-Methoden akzeptiert. Der Hauptzweck der neuen Syntax, die Laravel 5.7 eingeführt hat, besteht darin, direktl</p> </div> </div> <a href="https://www.php.cn/de/phpkj/" class="phpgenera_Details_mainL4_botton"> <span>See all articles</span> <img src="/static/imghw/down_right.png" alt="" /> </a> </div> </div> </div> </main> <footer> <div class="footer"> <div class="footertop"> <img src="/static/imghw/logo.png" alt=""> <p>Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!</p> </div> <div class="footermid"> <a href="https://www.php.cn/de/about/us.html">Über uns</a> <a href="https://www.php.cn/de/about/disclaimer.html">Haftungsausschluss</a> <a href="https://www.php.cn/de/update/article_0_1.html">Sitemap</a> </div> <div class="footerbottom"> <p> © php.cn All rights reserved </p> </div> </div> </footer> <input type="hidden" id="verifycode" value="/captcha.html"> <script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script> <script src="/static/js/common_new.js"></script> <script type="text/javascript" src="/static/js/jquery.cookie.js?1745452401"></script> <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> <link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' /> <script type='text/javascript' src='/static/js/viewer.min.js?1'></script> <script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script> <script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function () { var u = "https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '9']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s); })(); </script> <script> // top layui.use(function () { var util = layui.util; util.fixbar({ on: { mouseenter: function (type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function (type) { layer.closeAll("tips"); }, }, }); }); document.addEventListener("DOMContentLoaded", (event) => { // 定义一个函数来处理滚动链接的点击事件 function setupScrollLink(scrollLinkId, targetElementId) { const scrollLink = document.getElementById(scrollLinkId); const targetElement = document.getElementById(targetElementId); if (scrollLink && targetElement) { scrollLink.addEventListener("click", (e) => { e.preventDefault(); // 阻止默认链接行为 targetElement.scrollIntoView({ behavior: "smooth" }); // 平滑滚动到目标元素 }); } else { console.warn( `Either scroll link with ID '${scrollLinkId}' or target element with ID '${targetElementId}' not found.` ); } } // 使用该函数设置多个滚动链接 setupScrollLink("Article_Details_main1L2s_1", "article_main_title1"); setupScrollLink("Article_Details_main1L2s_2", "article_main_title2"); setupScrollLink("Article_Details_main1L2s_3", "article_main_title3"); setupScrollLink("Article_Details_main1L2s_4", "article_main_title4"); setupScrollLink("Article_Details_main1L2s_5", "article_main_title5"); setupScrollLink("Article_Details_main1L2s_6", "article_main_title6"); // 可以继续添加更多的滚动链接设置 }); window.addEventListener("scroll", function () { var fixedElement = document.getElementById("Article_Details_main1Lmain"); var scrollTop = window.scrollY || document.documentElement.scrollTop; // 兼容不同浏览器 var clientHeight = window.innerHeight || document.documentElement.clientHeight; // 视口高度 var scrollHeight = document.documentElement.scrollHeight; // 页面总高度 // 计算距离底部的距离 var distanceToBottom = scrollHeight - scrollTop - clientHeight; // 当距离底部小于或等于300px时,取消固定定位 if (distanceToBottom <= 980) { fixedElement.classList.remove("Article_Details_main1Lmain"); fixedElement.classList.add("Article_Details_main1Lmain_relative"); } else { // 否则,保持固定定位 fixedElement.classList.remove("Article_Details_main1Lmain_relative"); fixedElement.classList.add("Article_Details_main1Lmain"); } }); </script> <script> document.addEventListener('DOMContentLoaded', function() { const mainNav = document.querySelector('.Article_Details_main1Lmain'); const header = document.querySelector('header'); if (mainNav) { window.addEventListener('scroll', function() { const scrollPosition = window.scrollY; if (scrollPosition > 84) { mainNav.classList.add('fixed'); } else { mainNav.classList.remove('fixed'); } }); } }); </script> </body> </html>