freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

laravel入門中文手冊-資料下載頁

2025-06-25 07:04本頁面
  

【正文】 taAfter a user creates an account or signs into your application, it is mon to display a wele or status message. But, how can you set the status message so it is available for the next request? Use the with() method to send flash data along with the redirect response.return Redirect::to(39。profile39。)with(39。status39。, 39。Wele Back!39。)。You can access your message from the view with the Session get method:$status = Session::get(39。status39。)。Further Reading: Sessions下載Sending a file download response:return Response::download(39。file/39。)。Sending a file download and assigning a file name:return Response::download(39。file/39。, 39。39。)。錯誤To generating proper error responses simply specify the response code that you wish to return. The corresponding view stored in views/error will automatically be returned.返回一個帶有404錯誤碼的Response實例:return Response::error(39。40439。)。返回一個帶有500錯誤碼的Response實例:return Response::error(39。50039。)。管理靜態(tài)資源文件目錄 注冊靜態(tài)資源文件 Dumping Assets 靜態(tài)資源文件間的依賴關系 靜態(tài)資源文件容器 擴展包中的靜態(tài)資源文件注冊靜態(tài)資源文件The Asset class provides a simple way to manage the CSS and JavaScript used by your application. To register an asset just call the add method on the Asset class:注冊一個靜態(tài)資源文件Asset::add(39。jquery39。, 39。js/39。)。The add method accepts three parameters. The first is the name of the asset, the second is the path to the asset relative to the public directory, and the third is a list of asset dependencies (more on that later). Notice that we did not tell the method if we were registering JavaScript or CSS. The add method will use the file extension to determine the type of file we are registering.輸出靜態(tài)資源文件地址When you are ready to place the links to the registered assets on your view, you may use the styles or scripts methods:向視圖中輸出靜態(tài)資源文件地址:head ?php echo Asset::styles()。 ? ?php echo Asset::scripts()。 ?/head靜態(tài)資源文件間的依賴關系Sometimes you may need to specify that an asset has dependencies. This means that the asset requires other assets to be declared in your view before it can be declared. Managing asset dependencies couldn39。t be easier in Laravel. Remember the names you gave to your assets? You can pass them as the third parameter to the add method to declare dependencies:Registering a bundle that has dependencies:注冊某個擴展包Asset::add(39。jqueryui39。, 39。js/39。, 39。jquery39。)。In this example, we are registering the jqueryui asset, as well as specifying that it is dependent on the jquery asset. Now, when you place the asset links on your views, the jQuery asset will always be declared before the jQuery UI asset. Need to declare more than one dependency? No problem:Registering an asset that has multiple dependencies:Asset::add(39。jqueryui39。, 39。js/39。, array(39。first39。, 39。second39。))。靜態(tài)資源文件容器To increase response time, it is mon to place JavaScript at the bottom of HTML documents. But, what if you also need to place some assets in the head of your document? No problem. The asset class provides a simple way to manage asset containers. Simply call the container method on the Asset class and mention the container name. Once you have a container instance, you are free to add any assets you wish to the container using the same syntax you are used to:獲取一個靜態(tài)資源文件容器的實例:Asset::container(39。footer39。)add(39。example39。, 39。js/39。)。從某個容器中輸出所有靜態(tài)資源文件地址:echo Asset::container(39。footer39。)scripts()。擴展包中的靜態(tài)資源文件Before learning how to conveniently add and dump bundle assets, you may wish to read the documentation on creating and publishing bundle assets.When registering assets, the paths are typically relative to the public directory. However, this is inconvenient when dealing with bundle assets, since they live in the public/bundles directory. But, remember, Laravel is here to make your life easier. So, it is simple to specify the bundle which the Asset container is managing.Specifying the bundle the asset container is managing:Asset::container(39。foo39。)bundle(39。admin39。)。Now, when you add an asset, you can use paths relative to the bundle39。s public directory. Laravel will automatically generate the correct full paths.模版目錄 基礎 片段 Blade模版引擎 Blade控制結構 Blade布局基礎也許你的應用中所有頁面都是用同樣的布局方式,如果手工的為每一個控制器action方法都創(chuàng)建一次頁面布局將會是非常痛苦的,如果能夠為控制器指定一個公用布局的話將會讓開發(fā)變得更輕松。下面就來介紹如何實現吧:為控制器指定一個 layout 屬性:class Base_Controller extends Controller { public $layout = 39。39。}在控制器action方法中訪問 layout 屬性:public function action_profile(){ $thislayoutnest(39。content39。, 39。39。)。}注: 控制器中使用了公共布局之后,action方法不許要返回任何東西了。SectionsView sections provide a simple way to inject content into layouts from nested views. For example, perhaps you want to inject a nested view39。s needed JavaScript into the header of your layout. Let39。s dig in:Creating a section within a view:?php Section::start(39。scripts39。)。 ? script src=/script?php Section::stop()。 ?Rendering the contents of a section:head ?php echo Section::yield(39。scripts39。)。 ?/headUsing Blade shortcuts to work with sections:@section(39。scripts39。) script src=/script@endsectionhead @yield(39。scripts39。)/headBlade模版引擎Blade makes writing your views pure bliss. To create a blade view, simply name your view file with a . extension. Blade allows you to use beautiful, unobtrusive syntax for writing PHP control structures and echoing data. Here39。s an example:輸出一個變量:Hello, {{ $name }}.輸出函數的返回值:{{ Asset::styles() }}輸出視圖(view)你可以在一個視圖中使用 @include 指令輸出另一個視圖。被輸出的視圖會自動繼承當前視圖的所有數據。h1Profile/hi@include(39。39。)同樣的,你還可以使用 @render 指令輸出一個視圖,和 @include 指令不同的是,@render 指令輸出的視圖 不會 繼承當前視圖的數據。@render(39。39。)Blade注釋:{{ 只是一行注釋 }}{{ 這是一個 多行 注釋。}}注: 和HTML注釋不同,Blade注釋不會出現在生成的HTML源碼中。Blade控制結構For 循環(huán):@for ($i = 0。 $i = count($ments)。 $i++) The ment body is {{ $ments[$i] }}@endforForeach 循環(huán):@foreach ($ments as $ment) The ment body is {{ $mentbody }}.@endforeachWhile 循環(huán):@while ($something) I am s
點擊復制文檔內容
環(huán)評公示相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1