PHP学习心得


创建简单路由及页面

<ul> <li>项目根目录为:D:\phpstudy_pro\WWW\laravel8\blog\</li> </ul> <h2>创建简单路由</h2> <ul> <li>routes/web.php</li> </ul> <pre><code class="language-php">Route::get('hello', function () { return '您好,世界'; });</code></pre> <ul> <li>打开浏览器访问:<a href="http://lblog.com/hello">http://lblog.com/hello</a></li> <li>页面显示: 您好,世界</li> </ul> <h2>创建简单页面</h2> <ul> <li>routes/web.php</li> </ul> <pre><code class="language-php">Route::get('hello/page', function () { return view('hello'); });</code></pre> <ul> <li> <p>创建页面文件: resources/views/hello.blade.php</p> </li> <li>页面写入内容</li> </ul> <pre><code class="language-html">&lt;h1&gt;您好,世界&lt;/h1&gt;</code></pre> <ul> <li>打开浏览器访问:<a href="http://lblog.com/hello/page">http://lblog.com/hello/page</a></li> <li>页面显示:您好,世界</li> </ul>

页面列表

ITEM_HTML