本文整理汇总了PHP中Field::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::create方法的具体用法?PHP Field::create怎么用?PHP Field::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$input = Input::all();
$validation = Validator::make($input, Field::$rules);
if ($validation->passes()) {
$this->field->create($input);
return Redirect::route('fields.index');
}
return Redirect::route('fields.create')->withInput()->withErrors($validation)->with('message', 'There were validation errors.');
}
示例2: run
public function run()
{
DB::table('fields')->delete();
Field::create(array('id' => 1, 'field' => 'inf', 'level' => 1));
Field::create(array('id' => 2, 'field' => 'geo', 'level' => 1));
Field::create(array('id' => 3, 'field' => 'os', 'level' => 1));
Field::create(array('id' => 4, 'field' => 'inf', 'level' => 2));
Field::create(array('id' => 5, 'field' => 'geo', 'level' => 2));
Field::create(array('id' => 6, 'field' => 'os', 'level' => 2));
}
示例3: __construct
public function __construct($data, $templateHandler, $optionData)
{
$this->configData = $data;
$this->templateHandler = $templateHandler;
foreach ($this->configData->fields as $fieldData) {
$data = null;
if (array_key_exists($fieldData->name, $optionData)) {
$data = $optionData[$fieldData->name];
} else {
if (property_exists($fieldData, 'default')) {
$data = $fieldData->default;
}
}
$this->fields[] = Field::create($fieldData, $this->templateHandler, $data);
}
}
示例4: __construct
public function __construct($data, $templateHandler)
{
$this->configData = $data;
$this->templateHandler = $templateHandler;
foreach ($this->configData->fields as $fieldData) {
if (array_key_exists('post', $_GET)) {
$post_id = $_GET['post'];
$data = get_post_meta($post_id, $fieldData->name, true);
} else {
$data = false;
}
if ($data === false && property_exists($fieldData, 'default')) {
$data = $fieldData->default;
}
$this->fields[] = Field::create($fieldData, $this->templateHandler, $data);
}
}
示例5: foreach
$field_id = $column_description['strScreenTitle'];
}
}
$field = Field::create()->find($field_id);
echo $field['strName'];
break;
case 'COL_CIRCULATION_FIELD2':
echo "<td class=\"table_header\" align=\"left\" nowrap>";
echo "<a style=\"color: #fff;\">";
$field_id = 1;
foreach ($arrCONF_AllCols as $column_description) {
if ($column_description['strTitle'] == 'COL_CIRCULATION_FIELD2') {
$field_id = $column_description['strScreenTitle'];
}
}
$field = Field::create()->find($field_id);
echo $field['strName'];
break;
}
echo '</a></td>';
}
if ($archivemode != 1) {
?>
<td class="table_header">
<?php
echo $CIRCULATION_VIEW_PROCESS;
?>
</td>
<?php
}
?>