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


PHP Monitor::save方法代码示例

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


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

示例1: actionTambah

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'ubah' page.
  */
 public function actionTambah()
 {
     $model = new UploadMonitorForm();
     $monitor = new Monitor();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['UploadMonitorForm'])) {
         $scriptFile = CUploadedFile::getInstanceByName('UploadMonitorForm[nama_file]');
         if (isset($scriptFile)) {
             $ini_array = parse_ini_file($scriptFile->tempName, true);
             // echo "Nama: {$ini_array['description']['name']} <br />";
             // echo "Descripsi: {$ini_array['description']['description']} <br />";
             // echo "Perintah: {$ini_array['config']['command']} <br />";
             // echo "Output: {$ini_array['config']['output']} <br />";
             // echo "View: {$ini_array['config']['view']}";
             //$monitor = new Monitor;
             $monitor->nama = $ini_array['description']['name'];
             $monitor->deskripsi = $ini_array['description']['description'];
             $monitor->perintah = $ini_array['config']['command'];
             $monitor->output_type_id = OutputType::model()->find("nama = '{$ini_array['config']['output']}'")->id;
             $monitor->view_type_id = isset($ini_array['config']['view']) ? ViewType::model()->find("nama = '{$ini_array['config']['view']}'")->id : NULL;
             $monitor->prefix = isset($ini_array['config']['prefix']) ? $ini_array['config']['prefix'] : NULL;
             $monitor->suffix = isset($ini_array['config']['suffix']) ? $ini_array['config']['suffix'] : NULL;
             if ($monitor->save()) {
                 $this->redirect(array('ubah', 'id' => $monitor->id));
             }
         }
     }
     $this->render('tambah', array('model' => $model, 'monitor' => $monitor));
 }
开发者ID:nurulimamnotes,项目名称:ahadmon,代码行数:34,代码来源:MonitorController.php

示例2: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Monitor();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Monitor'])) {
         $model->attributes = $_POST['Monitor'];
         if ($model->save()) {
             $this->redirect(array('admin'));
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:jencina,项目名称:checklist,代码行数:17,代码来源:MonitorController.php

示例3: testCreate

 public function testCreate()
 {
     $this->object->name = "Monitor 6";
     $this->object->size = 7;
     $this->assertTrue($this->object->save(FALSE));
 }
开发者ID:nurielmeni,项目名称:nymedia,代码行数:6,代码来源:MonitorTest.php


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