duancuo1234
2018-01-31 15:54
浏览 195
已采纳

> = .. PHP Laravel后的运算符

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);
}

图片转代码服务由CSDN问答提供 功能建议

今天在Laravel Paginator.php中出现此代码

  $ this-> hasMore = $ this-> items-> count()>  $ this-> perPage; 
   
 
 

我很熟悉 - > 和> 但是不确定这是多么适合= =。 这是完整的函数:

  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); 
} 
   
 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题