本文整理汇总了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();
}