src/Form.php
public function checkbox($name, $inputValue = 1, $checkByDefault = false)
    {
        $value = $this->value($name);
        // Define the state for the checkbox, when $value is null then we
        // use the $checkByDefault value directly, otherwise the checkbox will
        // be checked only if the $value is equal to the $inputValue.
        if (is_null($value)) {
            $checked = $checkByDefault;
        } else {
            $checked = $value == $inputValue;
        }

        $name = e($name);
        $inputValue = e($inputValue);
        $checked = $checked ? ' checked' : '';
        return "name=\"$name\" value=\"$inputValue\"$checked";
    }
public function checkbox($name, $inputValue = 1, $checkByDefault = false)
    {
        $value = $this->value($name);
        // Define the state for the checkbox, when $value is null then we
        // use the $checkByDefault value directly, otherwise the checkbox will
        // be checked only if the $value is equal to the $inputValue.
        if (is_null($value)) {
            $checked = $checkByDefault;
        } else {
            $checked = $value == $inputValue;
        }

        $name = e($name);
        $inputValue = e($inputValue);
        $checked = $checked ? ' checked' : '';
        return "name=\"$name\" value=\"$inputValue\"$checked";
    }
public function checkbox ( $ name , $ inputValue = 1 , $ checkByDefault = false ) { $ value = $ this -> value ( $ name ) ; // Define the state for the checkbox, when $value is null then we // use the $checkByDefault value directly, otherwise the checkbox will // be checked only if the $value is equal to the $inputValue. if ( is_null ( $ value ) ) { $ checked = $ checkByDefault ; } else { $ checked = $ value == $ inputValue ; } $ name = e ( $ name ) ; $ inputValue = e ( $ inputValue ) ; $ checked = $ checked ? ' checked' : '' ; return "name=\"$name\" value=\"$inputValue\"$checked" ; }
Get the attributes for a checkbox.

@param  string $name
@param  mixed $inputValue
@param  bool $checkByDefault
@return string
Get the attributes for a checkbox .