本文整理汇总了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.');
}
示例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);
}
}
示例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;
}
}
}
示例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';
}
示例5: setType
public function setType($strType)
{
$this->_type = Type::create()->setType($strType);
}