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


PHP Type::create方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::all();
     $validation = Validator::make($input, Type::$rules);
     if ($validation->passes()) {
         $this->type->create($input);
         return Redirect::route('admin.types.index');
     }
     return Redirect::route('admin.types.create')->withInput()->withErrors($validation)->with('message', 'There were validation errors.');
 }
开发者ID:jacobDaeHyung,项目名称:Laravel-Real-Estate-Manager,代码行数:15,代码来源:TypesController.php

示例2: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $types = array(array('name' => 'Skin'), array('name' => 'Rank Set'), array('name' => 'MOD'));
     foreach ($types as $type) {
         Type::create($type);
     }
 }
开发者ID:anodyne,项目名称:xtras,代码行数:12,代码来源:TypeSeeder.php

示例3: parametrize

 function parametrize($event = array())
 {
     $create = false;
     if (!empty($event['create']) && empty($event['errors'])) {
         $create = true;
         $entity = $event['create'];
     }
     if ($create) {
         switch ($entity) {
             case "types":
                 App::import('Model', 'Type');
                 $Type = new Type();
                 $types = array();
                 $types[] = array('type' => 'EMAIL', 'description' => 'Email access');
                 $types[] = array('type' => 'TWITTER', 'description' => 'Twitter access');
                 foreach ($types as $type) {
                     $Type->create();
                     $Type->save($type);
                 }
                 break;
         }
     }
 }
开发者ID:serumax,项目名称:pitutaria,代码行数:23,代码来源:params.php

示例4: ticket_type

 function ticket_type($id = FALSE, $condition = FALSE)
 {
     if ($condition == "delete") {
         $_POST["inactive"] = "1";
         $type = Type::find_by_id($id);
         $type->update_attributes($_POST);
     } else {
         if ($_POST) {
             unset($_POST['send']);
             if ($id) {
                 $type = Type::find_by_id($id);
                 $type->update_attributes($_POST);
             } else {
                 $type = Type::create($_POST);
             }
             if ($type) {
                 $this->session->set_flashdata('message', 'success:' . $this->lang->line('messages_save_settings_success'));
                 redirect('settings/ticket');
             } else {
                 $this->session->set_flashdata('message', 'error:' . $this->lang->line('messages_save_settings_error'));
                 redirect('settings/ticket');
             }
         } else {
             if ($id) {
                 $this->view_data['type'] = Type::find_by_id($id);
             }
             $this->view_data['title'] = $this->lang->line('application_type');
             $this->view_data['form_action'] = 'settings/ticket_type/' . $id;
             $this->content_view = 'settings/_ticket_type';
         }
     }
     $this->theme_view = 'modal_nojs';
 }
开发者ID:timclifford,项目名称:freelance-manager,代码行数:33,代码来源:settings.php

示例5: setType

 public function setType($strType)
 {
     $this->_type = Type::create()->setType($strType);
 }
开发者ID:MossesX,项目名称:mongo-cms,代码行数:4,代码来源:Reference.php


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