protected function createCheckbox($name, $options)
    {
        $box = new Checkbox($name, $options);
        $box->setAttribute('checked', true)
            ->setAttribute(
                'id',
                preg_replace(
                    array('~\[~', '~\]~', '~--+~', '~-$~'),
                    array('-', '', '-', ''),
                    $name
                )
            );

        return $box;
    }
protected function createCheckbox($name, $options)
    {
        $box = new Checkbox($name, $options);
        $box->setAttribute('checked', true)
            ->setAttribute(
                'id',
                preg_replace(
                    array('~\[~', '~\]~', '~--+~', '~-$~'),
                    array('-', '', '-', ''),
                    $name
                )
            );

        return $box;
    }
protected function createCheckbox ( $ name , $ options ) { $ box = new Checkbox ( $ name , $ options ) ; $ box -> setAttribute ( 'checked' , true ) -> setAttribute ( 'id' , preg_replace ( array ( '~\[~' , '~\]~' , '~--+~' , '~-$~' ) , array ( '-' , '' , '-' , '' ) , $ name ) ) ; return $ box ; }
Creates a toggle checkbox.

@param string $name
@param array  $options

@return Checkbox
Creates a toggle checkbox .