public function setValue($value)
	{
		$this->value = $value;

		if ( ! is_array($value) && ! $value instanceof \ArrayAccess)
		{
			$valueArray = [$value];
		}
		else
		{
			$valueArray = $value;
		}

		// Loop through the contents and make any checked that need to be
		foreach ($this->getContents() as $checkbox)
		{
			$checkboxValue = $checkbox->getValue();
			if (in_array($checkboxValue, $valueArray))
			{
				$checkbox->setChecked(true);
			}
			else
			{
				$checkbox->setChecked(false);
			}
		}

		return $this;
	}
public function setValue($value)
	{
		$this->value = $value;

		if ( ! is_array($value) && ! $value instanceof \ArrayAccess)
		{
			$valueArray = [$value];
		}
		else
		{
			$valueArray = $value;
		}

		// Loop through the contents and make any checked that need to be
		foreach ($this->getContents() as $checkbox)
		{
			$checkboxValue = $checkbox->getValue();
			if (in_array($checkboxValue, $valueArray))
			{
				$checkbox->setChecked(true);
			}
			else
			{
				$checkbox->setChecked(false);
			}
		}

		return $this;
	}
public function setValue ( $ value ) { $ this -> value = $ value ; if ( ! is_array ( $ value ) && ! $ value instanceof \ ArrayAccess ) { $ valueArray = [ $ value ] ; } else { $ valueArray = $ value ; } // Loop through the contents and make any checked that need to be foreach ( $ this -> getContents ( ) as $ checkbox ) { $ checkboxValue = $ checkbox -> getValue ( ) ; if ( in_array ( $ checkboxValue , $ valueArray ) ) { $ checkbox -> setChecked ( true ) ; } else { $ checkbox -> setChecked ( false ) ; } } return $ this ; }
Sets the value of the group, this will define which elements are selected or checked.
If an array is given multiple checkboxes can be enabled.

@param  mixed $value

@return $this

@since 2.0
Sets the value of the group this will define which elements are selected or checked . If an array is given multiple checkboxes can be enabled .