本文整理汇总了PHP中Feed::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::orderBy方法的具体用法?PHP Feed::orderBy怎么用?PHP Feed::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feed
的用法示例。
在下文中一共展示了Feed::orderBy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
parent::__construct();
$this->beforeFilter(function () {
if (!Auth::check()) {
return Redirect::to('auth');
}
});
$this->taxonomy = Taxonomy::get('page');
Event::listen('page_attachment', function ($page) {
echo View::make('sections.feed.attachment-page', array('post' => $page->toArray(), 'list' => Feed::orderBy('name', 'asc')->get()));
});
}
示例2: getEditpost
/**
* edit post page
* @param int $post_id
*/
public function getEditpost($post_id)
{
User::onlyHas('feedpost-edit');
$post = Post::find($post_id);
if (empty($post->id) === TRUE) {
throw new Exception("Post not found!");
}
$feedsID = Post::feedsID($post_id);
$this->data['general'] = array('post' => $post, 'feeds' => Feed::orderBy('name', 'asc')->get(), 'post_feeds' => $feedsID, 'fields' => $feedsID ? FeedField::get($feedsID, $post_id, 0, 1) : array(), 'fields_out' => $feedsID ? FeedField::get($feedsID, $post_id, 0, 0) : array());
$this->data['post_langs'] = array();
foreach ($post->langs()->get() as $pl) {
$this->data['post_langs'][$pl->lang_id] = $pl;
$this->data['post_langs'][$pl->lang_id]['fields'] = $feedsID ? FeedField::get($feedsID, $post_id, $pl->lang_id) : array();
$this->data['post_langs'][$pl->lang_id]['fields_out'] = $feedsID ? FeedField::get($feedsID, $post_id, $pl->lang_id, 0) : array();
}
$this->layout->content = View::make('sections.feed.post-form')->with($this->data);
}
示例3: form
/**
* Edit / create person
* @param person id $id
* @return layout
*/
public function form($id = 0)
{
User::onlyHas('person-edit');
$data = array('person' => PersonModel::find($id), 'person_lang' => array(), 'module' => $this->module_name, 'person_groups' => PersonGroup::join(PersonGroupLang::getTableName(), PersonGroupLang::getField("group_id"), '=', PersonGroup::getField('id'))->select(PersonGroup::getField("id"), PersonGroupLang::getField("name"))->where(PersonGroupLang::getField("lang_id"), \WebAPL\Language::getId())->orderBy(\PersonGroupLang::getField('name'), 'asc')->get(), 'selected_groups' => array());
if ($data['person']) {
$personLangs = PersonModel::find($id)->langs()->get();
foreach ($personLangs as $personLang) {
$data['person_lang'][$personLang->lang_id] = $personLang;
}
$groups = PersonRelModel::where('person_id', $data['person']->id)->get();
foreach ($groups as $group) {
$data['selected_groups'][] = $group->group_id;
}
}
$data['feeds'] = \Feed::orderBy('name', 'asc')->get();
$this->layout->content = Template::moduleView($this->module_name, 'views.form', $data);
return $this->layout;
}