[FLOW3-general] fluid form.checkbox boolean

Bastian Waidelich bastian at typo3.org
Wed Apr 20 16:27:56 CEST 2011


Heiko Kromm | Paints wrote:

Hi Heiko,

> In my Domain Model I have a property isVisible, which is boolean.
>
> /**
> * Is visible
> *
> * @var boolean
> */
> protected $isVisible = true;

If you want to follow our CGL, this would be:

/**
  * @var boolean
  **/
protected $visible = TRUE;

/**
  * @return boolean
  **/
public function isVisible() {
	return $this->visible;
}

/**
  * @param boolean $visible
  **/
public function setVisible($visible) {
	$this->visible = $visible;
}


> Now I'm building an input form with fluid and have the field:
> <f:form.checkbox property="isVisible" id="isVisible" value="1" />

If you refer to a getter from within Fluid, you omit the "get" or "is":
<f:form.checkbox property="visible" id="isVisible" value="1" />


> When I try to save my new element I will get an error-message
> that isVisible is a string and that a boolean value is expected.

Which version of FLOW3 are you using? With the current version, this 
should work without changes.

Best,
Bastian


More information about the FLOW3-general mailing list