|
Revision 388, 1.2 kB
(checked in by schst, 2 years ago)
|
Added new imploder filter
|
- Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
class patForms_Filter_Implode extends patForms_Filter { |
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
* type of the filter |
|---|
| 27 |
* |
|---|
| 28 |
* @access private |
|---|
| 29 |
*/ |
|---|
| 30 |
var $_type = PATFORMS_FILTER_TYPE_PHP; |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
* Filter value that is returned by patForms |
|---|
| 34 |
* |
|---|
| 35 |
* This method is applied when patForms_Element::getValue() |
|---|
| 36 |
* or patForms::getValues() is called. |
|---|
| 37 |
* |
|---|
| 38 |
* @abstract |
|---|
| 39 |
* @access public |
|---|
| 40 |
* @param string value |
|---|
| 41 |
* @return float filtered value |
|---|
| 42 |
*/ |
|---|
| 43 |
function out($value) { |
|---|
| 44 |
if (is_array($value)) { |
|---|
| 45 |
$value = implode(', ', $value); |
|---|
| 46 |
} |
|---|
| 47 |
return $value; |
|---|
| 48 |
} |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
* Filter value that is passed to patForms |
|---|
| 52 |
* |
|---|
| 53 |
* This method is applied when patForms_Element::setValue() |
|---|
| 54 |
* or patForms::setValues() is called. |
|---|
| 55 |
* |
|---|
| 56 |
* @abstract |
|---|
| 57 |
* @access public |
|---|
| 58 |
* @param mixed value |
|---|
| 59 |
* @return mixed filtered value |
|---|
| 60 |
*/ |
|---|
| 61 |
function in($value) { |
|---|
| 62 |
return $value; |
|---|
| 63 |
} |
|---|
| 64 |
} |
|---|
| 65 |
?> |
|---|