本文整理匯總了PHP中app\News::lists方法的典型用法代碼示例。如果您正苦於以下問題:PHP News::lists方法的具體用法?PHP News::lists怎麽用?PHP News::lists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\News
的用法示例。
在下文中一共展示了News::lists方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: edit
public function edit($entity)
{
parent::edit($entity);
$this->edit = \DataEdit::source(new \App\Comments());
$this->edit->label('Edit Comment');
$this->edit->add('active', 'Active', 'checkbox');
/*its must be deleted*/
$this->edit->add('comment_id', 'ID', 'select')->options(\App\News::lists('id', 'id')->toArray());
$this->edit->add('name', 'Name', 'text');
$this->edit->add('comment', 'Comment', 'text');
/**/
return $this->returnEditView();
}
示例2: all
public function all($entity)
{
parent::all($entity);
$this->filter = \DataFilter::source(new \App\News());
$this->filter->add('active', 'Active', 'select')->options(\App\News::lists("Active", "active")->all());
$this->filter->add('title', 'Title', 'text');
$this->filter->add('title_en', 'Title(EN)', 'text');
$this->filter->add('published_at', 'Pub. Date', 'datetime')->format('Y-m-d H:i:s', 'uk');
$this->filter->add('created_at', 'Created Date', 'datetime')->format('Y-m-d H:i:s', 'uk');
$this->filter->submit('search');
$this->filter->reset('reset');
$this->filter->build();
$this->grid = \DataGrid::source($this->filter);
$this->grid->add('active', 'Active', 'active');
$this->grid->add('title', 'Title', 'title');
$this->grid->add('title_en', 'Title(En)', 'title_en');
$this->grid->add('segment', 'Segment');
$this->grid->add('content', 'Content');
$this->grid->add('published_at', 'Pub. Date', 'published_at');
$this->grid->add('created_at', 'Created Date', 'created_at');
$this->grid->add('img_url', 'Image');
$this->addStylesToGrid();
return $this->returnView();
}