本文整理匯總了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."]);
}
}