Added new fields and forms

This commit is contained in:
Antonio de la Rosa 2015-08-28 23:43:08 +02:00
parent 52d75b8029
commit 9db16a5edd
27 changed files with 832 additions and 34 deletions

View file

@ -0,0 +1,51 @@
<?php
/**
*
* @author Antonio de la Rosa <webmaster@web-t-sys.com>
* @file
* @package ExtraFields
*
*/
namespace PhangoApp\PhaModels\CoreFields;
class NormalizeField extends TextField {
public $form='HiddenForm';
public function check($value)
{
return $this->check_text($value);
}
function search_field($value)
{
return $this->check_text($value);
}
static public function check_text($value, $separator='-')
{
$str_normalize=slugify(strip_tags($value));
$arr_normalize=explode($separator, $str_normalize);
sort($arr_normalize);
$value=implode('%', $arr_normalize);
return $value;
}
}
?>