本文整理汇总了PHP中Field::setFromPOST方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::setFromPOST方法的具体用法?PHP Field::setFromPOST怎么用?PHP Field::setFromPOST使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field::setFromPOST方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setFromPOST
public function setFromPOST(array $settings = array())
{
parent::setFromPOST($settings);
if ($this->get('validator') == '') {
$this->remove('validator');
}
}
示例2: setFromPOST
public function setFromPOST($postdata)
{
parent::setFromPOST($postdata);
if ($this->get('validator') == '') {
$this->remove('validator');
}
}
示例3: setFromPOST
/**
* This function permits parsing different field settings values
*
* @param array $settings
* the data array to initialize if necessary.
*/
public function setFromPOST(array &$settings = array())
{
// call the default behavior
parent::setFromPOST($settings);
// declare a new setting array
$new_settings = array();
// set new settings
$new_settings['sections'] = is_array($settings['sections']) ? implode(self::SEPARATOR, $settings['sections']) : (is_string($settings['sections']) ? $settings['sections'] : null);
$new_settings['show_association'] = $settings['show_association'] == 'yes' ? 'yes' : 'no';
$new_settings['deepness'] = General::intval($settings['deepness']);
$new_settings['deepness'] = $new_settings['deepness'] < 1 ? null : $new_settings['deepness'];
$new_settings['elements'] = empty($settings['elements']) ? null : $settings['elements'];
$new_settings['mode'] = empty($settings['mode']) ? null : $settings['mode'];
$new_settings['allow_new'] = $settings['allow_new'] == 'yes' ? 'yes' : 'no';
$new_settings['allow_edit'] = $settings['allow_edit'] == 'yes' ? 'yes' : 'no';
$new_settings['allow_link'] = $settings['allow_link'] == 'yes' ? 'yes' : 'no';
$new_settings['allow_delete'] = $settings['allow_delete'] == 'yes' ? 'yes' : 'no';
// save it into the array
$this->setArray($new_settings);
}
示例4: setFromPOST
/**
* This function permits parsing different field settings values
*
* @param array $settings
* the data array to initialize if necessary.
*/
public function setFromPOST(array $settings = array())
{
// call the default behavior
parent::setFromPOST($settings);
// declare a new setting array
$new_settings = array();
// always display in table mode
$new_settings['show_column'] = 'yes';
// set new settings
$new_settings['field-classes'] = $settings['field-handles'];
//var_dump(isset($settings['table-width']));die;
$new_settings['table-width'] = isset($settings['table-width']) ? $settings['table-width'] : NULL;
$new_settings['table-height'] = isset($settings['table-height']) ? $settings['table-height'] : NULL;
$new_settings['table-resize'] = isset($settings['table-resize']) ? $settings['table-resize'] : NULL;
$new_settings['table-position'] = isset($settings['table-position']) ? $settings['table-position'] : NULL;
$new_settings['table-absolute'] = isset($settings['table-absolute']) && $settings['table-absolute'] == 'on' ? 'yes' : 'no';
$new_settings['entry-width'] = isset($settings['entry-width']) ? $settings['entry-width'] : NULL;
$new_settings['entry-height'] = isset($settings['entry-height']) ? $settings['entry-height'] : NULL;
$new_settings['entry-resize'] = isset($settings['entry-resize']) ? $settings['entry-resize'] : NULL;
$new_settings['entry-position'] = isset($settings['entry-position']) ? $settings['entry-position'] : NULL;
$new_settings['entry-absolute'] = isset($settings['entry-absolute']) && $settings['entry-absolute'] == 'on' ? 'yes' : 'no';
// save it into the array
$this->setArray($new_settings);
}
示例5: setFromPOST
/**
* This function permits parsing different field settings values
*
* @param array $settings
* the data array to initialize if necessary.
*/
public function setFromPOST(array $settings = array())
{
// call the default behavior
parent::setFromPOST($settings);
// declare a new setting array
$new_settings = array();
// set new settings
$new_settings['unique'] = isset($settings['unique']) && $settings['unique'] == 'on' ? 'yes' : 'no';
$new_settings['thumbs'] = isset($settings['thumbs']) && $settings['thumbs'] == 'on' ? 'yes' : 'no';
$new_settings['driver'] = isset($settings['driver']) && is_array($settings['driver']) ? implode(',', $settings['driver']) : null;
$new_settings['query_params'] = isset($settings['query_params']) && !!$settings['query_params'] ? $settings['query_params'] : null;
$new_settings['force_ssl'] = isset($settings['force_ssl']) && $settings['force_ssl'] == 'on' ? 'yes' : 'no';
$new_settings['unique_media'] = isset($settings['unique_media']) && $settings['unique_media'] == 'on' ? 'yes' : 'no';
// save it into the array
$this->setArray($new_settings);
}