本文整理汇总了PHP中app\Department::orderby方法的典型用法代码示例。如果您正苦于以下问题:PHP Department::orderby方法的具体用法?PHP Department::orderby怎么用?PHP Department::orderby使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Department
的用法示例。
在下文中一共展示了Department::orderby方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<div class="span3" id="sidebar">
<div class="container-fluid">
<div class="row-fluid">
<div class="span14">
<div class="well sidebar-nav">
<li class="nav-header">Departments with active routine</li>
<?php
use App\Schedule;
use App\Department;
$routineval = 0;
$departments = Department::orderby('code')->get();
foreach ($departments as $department) {
$schedules = Schedule::where('department_code', $department->code);
if ($schedules->exists()) {
$routineval = 1;
?>
<li><a href='home?depart=<?php
echo $department->code;
?>
'>{{ $department->code }}</a></li>
<?php
}
}
?>
@if($routineval == 0)
<li>No Schedule added yet. </li>
@endif
</div><!--/.well -->
</div><!--/span-->
</div>
</div>
示例2: array
@endsection
@section('navigation')
@include('layouts.include.nav_admin')
@endsection
@section('sidebar')
@include('layouts.include.adminsidebar')
@endsection
@section('bodycontent')
<div class = "span9">
{!! Form::open(array('action'=>'AdminScheduleController@viewbatchschedule', 'method'=>'post')) !!}
<?php
use App\Department;
$departements = Department::orderby('code')->lists('code', 'code');
?>
<fieldset>
<legend>Batch-wise Schedule</legend>
<div class="control-group">
{!! Form::label('departmentcode', 'Select Department:', array('class' => 'control-label')) !!}
<div class="controls">
{!! Form::select('selectdepartment', $departements) !!}
</div>
</div>
<div class="control-group">
<div class="controls">
{!! Form::submit('Select', ['class'=>'btn btn-primary','value'=>'showdepartbatch', 'name'=>'showdepartbatch']) !!}
</div>
</div>
</fieldset>
示例3: array
@endsection
@section('bodycontent')
<div class="container">
{!! Form::open(array('class'=>'form-horizontal', 'action'=>'UserController@registeruser','method'=>'post')) !!}
@if ($errors->has())
<div class="alert alert-danger">
@foreach ($errors->all() as $error)
{{ $error }}<br>
@endforeach
</div>
@endif
<fieldset>
<?php
use App\Department;
$departmentinfo = Department::orderby('code')->lists('code', 'code');
?>
<legend>Register a teacher</legend>
<div class="control-group">
{!! Form::label('userdepartment', 'Department:', array('class' => 'control-label')) !!}
<div class="controls">
{!! Form::select('userdepartment', $departmentinfo) !!}
</div>
</div>
<div class="control-group">
{!! Form::label('username', 'Username:', array('class' => 'control-label')) !!}
<div class="controls">
{!! Form::text('username', null, ['placeholder'=>'Enter new username']) !!}
</div>
</div>
<div class="control-group">