本文整理汇总了PHP中Subject::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Subject::all方法的具体用法?PHP Subject::all怎么用?PHP Subject::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subject
的用法示例。
在下文中一共展示了Subject::all方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public function create($course_id)
{
$course = Course::with('placements')->find($course_id);
$subjects = Subject::all();
$menu = 'academic';
return View::make('masteries.create', compact('course', 'subjects', 'menu'));
}
示例2: edit
public function edit($id)
{
$quiz = Quiz::find($id);
$subjects = Subject::all();
$employees = Employee::where('teach_salary', '>', 0.0)->get();
$menu = 'academic';
return View::make('quizzes.edit', compact('quiz', 'subjects', 'employees', 'menu'));
}
示例3: edit
public function edit($id)
{
$teach = Teach::find($id);
$employees = Employee::where('teach_salary', '>', 0.0)->get();
$subjects = Subject::all();
$hours = Hour::all();
$menu = 'employee';
return View::make('teaches.edit', compact('teach', 'employees', 'subjects', 'hours', 'menu'));
}
示例4: selectSubjects
public function selectSubjects()
{
$user_id = $_SESSION['user_id'];
$city_id = Volunteer::find($user_id)->city_id;
$selected_subjects = City::find($city_id)->subject()->get();
$selected_subjects_id = array();
foreach ($selected_subjects as $sub) {
$selected_subjects_id[] = $sub->id;
}
$all_subjects = Subject::all();
return View::make('settings/select-subjects')->with('selected_subjects_id', $selected_subjects_id)->with('all_subjects', $all_subjects);
}
示例5: index
public function index()
{
$subjects = Subject::all();
$menu = 'project';
return View::make('subjects.index', compact('subjects', 'menu'));
}
示例6: old
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="H4"> Adding Exam Type.......</h4>
</div>
<div class="modal-body">
<form action="{{URL::to('exams/exam-type')}}" method="post">
<div class="form-group">
<label>Pick Exam Type</label>
<select name="name"
{{ (Input:: old('name'))? ' value="'.Input::old('name').'"' : ''}}>
<option value="">----Select exam type---</option>
<?php
$subjects = Subject::all();
?>
@foreach($subjects as $subject)
<option value="{{$subject->name}}">{{$subject->name}} </option>
@endforeach
</select>
@if($errors->has('name'))
<span class="label label-danger">{{ $errors->first('name') }}
</span>
@endif
</div>
<div class="form-group">
<label>Description</label>
<textarea class="form-control" name="description"
示例7: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$classes = ClassModel::select('code', 'name')->orderby('code', 'asc')->get();
$subjects = Subject::all();
return View::Make('app.markCreate', compact('classes', 'subjects'));
}
示例8: array
<?php
if ($errors->first()) {
echo "<div class='alert alert-error alert-block fade in'>";
echo '<button type="button" class="close" data-dismiss="alert">×</button>';
echo $errors->first();
echo "</div>";
}
echo Form::open(array('url' => '/exam/edit/' . $id . '', 'method' => 'post', 'class' => 'form-horizontal'));
echo "<fieldset>";
echo Form::label('id', 'id', array('class' => 'pull-left', 'style' => 'clear:left;padding:15px;'));
echo Form::text('id', $id, array('disabled' => '', 'class' => 'disabled pull-right', 'style' => 'margin:10px;'));
echo Form::label('title', 'Title', array('class' => 'pull-left', 'style' => 'clear:left;margin:15px;'));
echo Form::text("title", Input::old('title', ''), array('placeholder' => 'Title of the Tutorial', 'class' => 'pull-right', 'style' => 'clear:right;margin:10px;'));
echo Form::label('subject', 'Subject', array('class' => 'pull-left', 'style' => 'clear:left;margin:15px;'));
$subjectsmodel = Subject::all();
function checkSubject($subjects, $subject)
{
foreach ($subjects as $s) {
if ($s == $subject) {
return 1;
}
}
return 0;
}
$usere = Sentry::getUser();
$usergroup = $usere->getGroups();
$usergroupe = json_decode($usergroup, true);
$usergroupe[0]['pivot']['group_id'];
$group = Sentry::findGroupById($usergroupe[0]['pivot']['group_id']);
$groupname = $group->name;
示例9: update
public function update()
{
$id = Input::get('id');
$tabla = Input::get('tabla');
switch ($tabla) {
case '0':
$clave = Input::get('clave');
$appat = Input::get('ap_pat');
$apmat = Input::get('ap_mat');
$nombre = Input::get('nombre');
$segnombre = Input::get('seg_nombre');
$tipo = Input::get('tipo');
$grado = Input::get('grado');
$tutorias = Input::get('tutorias');
$gestion = Input::get('gestion');
$investigacion = Input::get('investigacion');
$dependencias = Input::get('dependencias');
$edit = Professor::find($id);
$edit->clave = $clave;
$edit->ap_pat = $appat;
$edit->ap_mat = $apmat;
$edit->nombre = $nombre;
$edit->seg_nombre = $segnombre;
$edit->tipo = $tipo;
$edit->id_grado = $grado;
$edit->tutorias = $tutorias;
$edit->gestion = $gestion;
$edit->investigacion = $investigacion;
$edit->dependencias = $dependencias;
$edit->save();
return View::make('crud.crudMaestros')->with('professors', Professor::all());
break;
case '1':
$nombre = Input::get('nombre');
$semestre = Input::get('semestre');
$plan = Input::get('idPlan');
$edit = Subject::find($id);
$edit->nombre = $nombre;
$edit->semestre = $semestre;
$edit->id_plan = $plan;
$edit->save();
return View::make('crud.crudMaterias')->with('subjects', Subject::all());
break;
case '2':
$nombre = Input::get('nombre');
$edit = Aula::find($id);
$edit->nombre = $nombre;
$edit->save();
return View::make('crud.crudAulas')->with('aulas', Aula::all());
break;
case '3':
$nombre = Input::get('nombre');
$edit = Plan::find($id);
$edit->nombre = $nombre;
$edit->save();
return View::make('crud.crudPlanes')->with('plans', Plan::all());
break;
default:
//aqui me redirecciona a una pagina vacia solo con un mensaje 404
return View::make('landing');
break;
}
}