本文整理汇总了PHP中Program::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Program::all方法的具体用法?PHP Program::all怎么用?PHP Program::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Program
的用法示例。
在下文中一共展示了Program::all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($id)
{
$course = Course::find($id);
$classifications = Classification::all();
$generations = Generation::all();
$programs = Program::all();
$majors = Major::all();
$menu = 'project';
return View::make('courses.edit', compact('course', 'classifications', 'programs', 'generations', 'majors', 'menu'));
}
示例2: storeUser
public function storeUser()
{
$redir = $this->check();
if (isset($redir)) {
return $redir;
}
$user = Sentry::getUser();
if (Input::has('editor1')) {
$summary = Input::get('editor1');
$user->summary = $summary;
}
if (Input::has('editor2')) {
$experience = Input::get('editor2');
$user->experience = $experience;
}
if (Input::has('del-prog')) {
$del = Input::get('del-prog');
$ar = array();
foreach ($del as $key => $val) {
$ar[] = $key;
}
foreach ($ar as $delid) {
$progs = Program::where('ProgramName', '=', $delid)->get();
foreach ($progs as $prog) {
$user->programs()->detach($prog->id);
}
}
} elseif (Input::has('program') && !Input::has('del-prog')) {
$id = Input::get('program');
$progs = Program::where('ProgramName', '=', $id)->take(1)->get();
foreach ($progs as $prog) {
$user->programs()->attach($prog->id);
}
}
if (Input::has('email') && Input::has('fname') && Input::has('lname')) {
$email = Input::get('email');
$fname = Input::get('fname');
$lname = Input::get('lname');
$user->email = $email;
$user->first_name = $fname;
$user->last_name = $lname;
}
if (Input::hasFile('photo') && Input::file('photo')->isValid()) {
$formatTable = array('image/jpeg', 'image/png', 'image/gif', 'image/tga', 'image/tif', 'image/bmp');
$file = Input::file('photo');
$mime = $file->getMimeType();
foreach ($formatTable as $mimecheck) {
if ($mime == $mimecheck) {
$filename = Str::random(20) . '.' . $file->getClientOriginalExtension();
$destinationPath = "public/uploads";
$succes = $file->move($destinationPath, $filename);
$bodytag = str_replace("public/", "", $succes->getPathname());
$user->avatar = $bodytag;
$img = Image::make($bodytag)->resize(612, 612)->save();
}
}
}
$user->save();
//$user = Sentry::getUser();
//$prgs= $user->programs()->get(); var_dump($prgs); $user->programs()->attach(714);
$this->layout->title = APPNAME;
$programs = Program::all();
$this->layout->content = View::make('main.profile.edit')->with('user', $user)->with('programs', $programs);
}
示例3: getAllprogram
public function getAllprogram()
{
$program = Program::all();
return Response::json($program);
}