本文整理汇总了PHP中Forum::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Forum::where方法的具体用法?PHP Forum::where怎么用?PHP Forum::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forum
的用法示例。
在下文中一共展示了Forum::where方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getForumsInCategory
/**
* Retourne un tableau avec les forums dans la catégorie
*
*/
public function getForumsInCategory()
{
return Forum::where('parent_id', '=', $this->id)->get();
}
示例2:
<th>On Todo List?</th>
<th>Asymmetric?</th>
<th>Time Limited?</th>
<th>Player Specific?</th>
<th>Allowed Characters</th>
<th>Position</th>
</thead>
<tbody>
<?php
if ($category->name == "Trashed") {
$collection = Forum::onlyTrashed()->get();
} else {
if ($category->name == "Unassociated") {
$collection = Forum::whereNull('category_id')->get();
} else {
$collection = Forum::where('category_id', $category->id)->orderBy('position')->get();
}
}
?>
@foreach($collection as $forum)
<tr>
<td>
<a href="/dashboard/storyteller/manage/forums/{{$forum->id}}/edit" data-tooltip title="Edit">
<i class="icon-pencil"></i>
</a>
<a href="/dashboard/storyteller/manage/forums/{{$forum->id}}/characters" data-tooltip title="Permitted Characters">
<i class="icon-users"></i>
</a>
@if($category->name == "Trashed")
<a href="/dashboard/storyteller/manage/forums/{{$forum->id}}/restore" data-tooltip title="Restore">
<i class="icon-flash"></i>
示例3: index
/**
* Affiche la page d'accueil du forum
*
*/
public function index()
{
$categories = Forum::where('parent_id', '=', 0)->orderBy('position', 'ASC')->get();
return View::make('forum.index', array('categories' => $categories));
}
示例4: markCategoryRead
function markCategoryRead($id)
{
$user = Auth::user();
if ($user) {
foreach (Forum::where('category_id', $id)->get() as $forum) {
$forum->markForumRead($user->id);
}
return Redirect::to("/forums/");
} else {
return Response::json(["success" => false, "message" => "Not logged in."]);
}
}