Fixes in fields
This commit is contained in:
parent
a2e0b89f1a
commit
ae2e94d224
3 changed files with 5 additions and 36 deletions
|
|
@ -17,7 +17,7 @@ class CharField extends PhangoField {
|
|||
* Size of field in database
|
||||
*/
|
||||
public $size=20;
|
||||
|
||||
public $form='PhangoApp\PhaModels\Forms\BaseForm';
|
||||
|
||||
/**
|
||||
* Construct field with basic data...
|
||||
|
|
@ -31,7 +31,6 @@ class CharField extends PhangoField {
|
|||
{
|
||||
|
||||
$this->size=$size;
|
||||
$this->form='PhangoApp\PhaModels\Forms\BaseForm';
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@ class SlugifyField extends CharField {
|
|||
|
||||
public function check($value)
|
||||
{
|
||||
|
||||
if($this->field_related!='')
|
||||
|
||||
if($this->model_instance->post!='')
|
||||
{
|
||||
|
||||
if(isset($this->post[$this->field_related]))
|
||||
if(isset($this->model_instance->post[$this->field_related]))
|
||||
{
|
||||
|
||||
$value=slugify($this->post[$this->field_related]);
|
||||
$value=\PhangoApp\PhaUtils\Utils::slugify($this->model_instance->post[$this->field_related]);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,36 +46,6 @@ class SelectModelForm extends SelectForm{
|
|||
|
||||
return parent::form();
|
||||
|
||||
/*
|
||||
|
||||
$arr_selected[$this->default_value]=' selected';
|
||||
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
<select name="<?php echo $this->name; ?>">
|
||||
<?php
|
||||
|
||||
foreach($this->arr_select as $value => $select)
|
||||
{
|
||||
|
||||
settype($arr_selected[$value], 'string');
|
||||
|
||||
?>
|
||||
<option value="<?php echo $value; ?>"<?php echo $arr_selected[$value]; ?>><?php echo $select; ?></option>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
|
||||
$input=ob_get_contents();
|
||||
|
||||
ob_end_clean();
|
||||
|
||||
return $input;*/
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue