Fixes in fields

This commit is contained in:
Antonio de la Rosa 2016-01-26 03:50:47 +01:00
parent a2e0b89f1a
commit ae2e94d224
3 changed files with 5 additions and 36 deletions

View file

@ -17,7 +17,7 @@ class CharField extends PhangoField {
* Size of field in database * Size of field in database
*/ */
public $size=20; public $size=20;
public $form='PhangoApp\PhaModels\Forms\BaseForm';
/** /**
* Construct field with basic data... * Construct field with basic data...
@ -31,7 +31,6 @@ class CharField extends PhangoField {
{ {
$this->size=$size; $this->size=$size;
$this->form='PhangoApp\PhaModels\Forms\BaseForm';
} }

View file

@ -13,14 +13,14 @@ class SlugifyField extends CharField {
public function check($value) 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]);
} }

View file

@ -46,36 +46,6 @@ class SelectModelForm extends SelectForm{
return parent::form(); 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;*/
} }