当前位置: 首页>>代码示例>>PHP>>正文


PHP Program::all方法代码示例

本文整理汇总了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'));
 }
开发者ID:emanmks,项目名称:oneschool,代码行数:10,代码来源:CoursesController.php

示例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);
 }
开发者ID:g0ddish,项目名称:ResearchMonster,代码行数:64,代码来源:ProfileController.php

示例3: getAllprogram

 public function getAllprogram()
 {
     $program = Program::all();
     return Response::json($program);
 }
开发者ID:saifurrahman,项目名称:dev,代码行数:5,代码来源:ScheduleController.php


注:本文中的Program::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。