Just came by this code in Laravel Paginator.php today
$this->hasMore = $this->items->count() > $this->perPage;
I'm familiar with -> and > but not sure how this bigger than fits after an = . this is the full function :
protected function setItems($items)
{
$this->items = $items instanceof Collection ? $items : Collection::make($items);
$this->hasMore = $this->items->count() > $this->perPage;
$this->items = $this->items->slice(0, $this->perPage);
}
The right side is evaluated and the result is assigned to the left. This of it this way:
$a = ($b > $c);
Where this evaluates to a boolean:
($b > $c)
Alternatively:
$a = ($b > $c) ? true : false;
Or:
if ($b > $c) {
$a = true;
} else {
$a = false;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.