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


PHP Program::save方法代码示例

本文整理汇总了PHP中Program::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Program::save方法的具体用法?PHP Program::save怎么用?PHP Program::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Program的用法示例。


在下文中一共展示了Program::save方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionCreate

 public function actionCreate()
 {
     $model = new Program();
     if (isset($_POST['Program'])) {
         $model->setAttributes($_POST['Program']);
         if ($model->save()) {
             if (Yii::app()->getRequest()->getIsAjaxRequest()) {
                 Yii::app()->end();
             } else {
                 $this->redirect(array('view', 'id' => $model->id));
             }
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:hanihh,项目名称:vvs_v2,代码行数:15,代码来源:ProgramController.php

示例2: store

 public function store()
 {
     $daterange = explode('-', Input::get('range'));
     $start_date = trim($daterange[0]);
     $end_date = trim($daterange[1]);
     $program = new Program();
     $program->project_id = Auth::user()->curr_project_id;
     $program->location_id = Auth::user()->location_id;
     $program->name = Input::get('name');
     $program->description = Input::get('description');
     $program->start_date = date('Y-m-d', strtotime($start_date));
     $program->end_date = date('Y-m-d', strtotime($end_date));
     $program->save();
     Session::flash('message', 'Sukses membuka program baru!');
 }
开发者ID:emanmks,项目名称:oneschool,代码行数:15,代码来源:ProgramsController.php

示例3: postProgram

 public function postProgram()
 {
     $validator = Validator::make(Input::all(), Program::$rules);
     if ($validator->passes()) {
         $program = new Program();
         $program->name = Input::get('name');
         $program->category_id = Input::get('category_id');
         $program->classification = Input::get('classification');
         $program->audience_id = Input::get('audience_id');
         $program->language_id = Input::get('language_id');
         $program->save();
         return Response::json($program);
     } else {
         return 0;
     }
 }
开发者ID:saifurrahman,项目名称:dev,代码行数:16,代码来源:ProgramController.php

示例4: store

 /**
  * Store a newly created resource in storage.
  * POST /program
  *
  * @return Response
  */
 public function store()
 {
     //get current club
     $user = Auth::user();
     $club = $user->Clubs()->FirstOrFail();
     $uuid = Uuid::generate();
     $validator = Validator::make(Input::all(), Program::$rules);
     if ($validator->passes()) {
         $program = new Program();
         $program->id = $uuid;
         $program->name = Input::get('name');
         $program->club_id = $club->id;
         $program->user_id = $user->id;
         $program->description = Input::get('description');
         $status = $program->save();
         if ($status) {
             return Redirect::action('ProgramController@index')->with('messages', 'Program created successfully');
         }
     }
     $error = $validator->errors()->all(':message');
     return Redirect::action('ProgramController@create')->withErrors($validator)->withInput();
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:28,代码来源:ProgramController.php

示例5: actionInsertProgram

 public function actionInsertProgram()
 {
     Yii::app()->user->returnUrl = Yii::app()->request->urlReferrer;
     if ($_POST) {
         //		$cek = DatabaseUmum::cekExist("program","nama_program",$_POST['namaTP']); 	// cek menggunakan component DatabaseUmum
         $cek = DatabaseUmum::cekExist2('program', 'nama_program', 'tahun_anggaran', $_POST['namaTP'], $_POST['tahunTP']);
         if ($cek <= 0) {
             $program = new Program();
             $program->nama_program = $_POST['namaTP'];
             $program->kode_program = $_POST['kodeTP'];
             $program->target = $_POST['targetTP'];
             $program->tahun_anggaran = $_POST['tahunTP'];
             $program->id_rekaman = 0;
             if ($program->validate()) {
                 $program->save();
                 // echo $program->nama_program;
                 $this->redirect(array('index'));
             } else {
                 Yii::app()->user->setFlash('error', 'Maaf, simpan Program gagal. Mohon periksa kembali data yang anda inputkan');
                 $this->redirect(array('/errPage/errDB'));
             }
         } else {
             Yii::app()->user->setFlash('error', 'Maaf, simpan Program gagal. Data sudah ada');
             $this->redirect(array('/errPage/errDB'));
         }
     } else {
         $this->actionIndex();
     }
 }
开发者ID:Mapetik,项目名称:ekeg8791,代码行数:29,代码来源:RencanaProgramController.php


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