Learning LaravelThe current loop iteration (starts at 1). $loop->remaining The remaining loop iterations. $loop->count The total number of items in the array being iterated. $loop->first Whether this is the first iteration app/Helpers/document.php. You can put many helpers in one file (this is how Laravel does it) or you can split them up by name. HelpersServiceProvider.php Now let's create a service provider. Let's put it under Seeder. The class must a public function named run(). Inserting Data using a Seeder You can reference models in a seeder. use DB; use App\Models\User; class UserTableSeeder extends Illuminate\Database\Seeder{0 码力 | 216 页 | 1.58 MB | 1 年前3
Laravel 5.6 中文文档log_not_found off; } error_page 404 /index.php; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; fastcgi_index 可以使用 @if , @elseif , @else 和 @endif 来构造 if 语句,这些指令的功能和 PHP 相同: @if (count($records) === 1) I have one record! @elseif (count($records) > 1) I have multiple records! @else I don't have $loop->index 当前循环迭代索引 (从 0 开始) $loop->iteration 当前循环迭代 (从 1 开始) $loop->remaining 当前循环剩余的迭代 $loop->count 迭代数组元素的总数量 $loop->first 是否是当前循环的第一个迭代 $loop->last 是否是当前循环的最后一个迭代 $loop->depth 当前循环的嵌套层级0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 6.0 中文文档@param View $view * @return void */ public function compose(View $view) { $view->with('count', $this->users->count()); } } 视图被渲染前,Composer 类的 compose 方法被调用,同 时 Illuminate\View\View 实例被注入该方法,从而可以使用 可以使用 @if , @elseif , @else 和 @endif 来构造 if 语句,这些指 令的功能和 PHP 相同: @if (count($records) === 1) I have one record! @elseif (count($records) > 1) I have multiple records! @else I don't have any records $loop->index 当前循环迭代索引 (从 0 开始) $loop->iteration 当前循环迭代 (从 1 开始) $loop->remaining 当前循环剩余的迭代 $loop->count 迭代数组元素的总数量 $loop->first 是否是当前循环的第一个迭代 $loop->last 是否是当前循环的最后一个迭代 $loop->even 是否是当前循环的偶数迭代 $loop->odd0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.0 Documentation
iii. Contract Reference iv. How To Use Contracts iv. Facades i. Introduction ii. Explanation iii. Practical Usage iv. Creating Facades v. Mocking Facades vi. Facade Class Reference v. Request Lifecycle but as middleware. Edit any routes or controllers that reference the old default filters (e.g. ['before' => 'auth'] ) and change them to reference the new middleware (e.g. ['middleware' => 'auth']. ) Illuminate\View\Environment class or Illuminate\Pagination\Environment class, update your code to reference Illuminate\View\Factory and Illuminate\Pagination\Factory instead. These two classes have been0 码力 | 242 页 | 1.44 MB | 1 年前3
Laravel 5.3 中文文档方法,从而允许我们 在视图中显示错误信息:Create Post
@if (count($errors) > 0)- @foreach ($errors->all() void */ public function compose(View $view) { $view->with('count', $this->users->count()); } } 视图被渲染前,Composer 类的 compose 方法被调用,同时 Illuminate\Contracts\View\View 被 @if , @elseif , @else 和 @endif 来构造 if 语句,这些指令函数和 PHP 的相同: @if (count($records) === 1) I have one record! @elseif (count($records) > 1) I have multiple records! @else I don't
0 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 3.2 Documentationdocumentation. These documents were designed to function both as a getting-started guide and as a feature reference. Even though you may jump into any section and start learning, we recommend reading the documentation up with a bunch of pagination configuration. Instead of pulling in the current page, getting a count of db records, and selected your data using a limit/offset just call 'paginate' and tell Laravel Str::singular('users'); Getting the plural form if given value is greater than one: echo Str::plural('comment', count($comments)); Slugs Generating a URL friendly slug: return Str::slug('My First Blog Post!');0 码力 | 139 页 | 1.13 MB | 1 年前3
The Laravel Handbook
different directives @for @foreach @while Like this: @for ($i = 0; $i < 10; $i++) Count: {{ $i }} @endfor- @foreach ($cats as $cat)
- {{ $cat }} @endforeach can use partials, but now let’s just add it to the welcome template: Here’s the full code for reference: @auth
0 码力 | 111 页 | 14.25 MB | 1 年前3
Laravel 5.2 中文文档void */ public function compose(View $view) { $view->with('count', $this->users->count()); } } 视图被渲染前,Composer 类的 compose 方法被调用,同 时 Illuminate\Contracts\View\View 被注入该方法,从而可以使用其 可以使用 @if , @elseif , @else 和 @endif 来构造 if 语句,这些指令函数和 PHP 的相 同: @if (count($records) === 1) I have one record! @elseif (count($records) > 1) I have multiple records! @else I don't 队列构建器还提供了很多聚合方法,比如 count, max, min, avg, 和 sum,你可以在构造查询 之后调用这些方法: 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 90 $users = DB::table('users')->count(); $price = DB:0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 5.1 中文文档@return void */ public function compose(View $view) { $view->with('count', $this->users->count()); } } 本文档由 Laravel 学院(LaravelAcademy.org)提供 51 视图被渲染前,composer 的 compose 可以使用@if, @elseif, @else, 和 @endif 来构造 if 语句,这些指令函数和 PHP 的相同: @if (count($records) === 1) I have one record! @elseif (count($records) > 1) I have multiple records! @else I don't have $title) { echo $title; } 2.5 聚合函数 队列构建器还提供了很多聚合方法,比如 count, max, min, avg, 和 sum,你可以在构造查询 之后调用这些方法: $users = DB::table('users')->count();$price = DB::table('orders ')->max('price'); 当然,你可以联合其它查询字句和聚合函数来构建查询:0 码力 | 307 页 | 3.46 MB | 1 年前3
《Slides Dev Web》 05. JavaScript & DOM
osures.asp 20https://www.promisejs.org/ 21https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise 22https://web.dev/articles/promises?hl=fr 3 escape(), unescape(), isFinite() com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f 36https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference 37https://javascript.info/ 38http://www.w3schools.com/js/ 39http://bioub.github.io/dom-visualizer/0 码力 | 10 页 | 91.95 KB | 1 年前3
共 12 条
- 1
- 2













