Skip to content

Commit

Permalink
revising checkbox template to properly link label w/ control
Browse files Browse the repository at this point in the history
  • Loading branch information
soletan committed Dec 26, 2016
1 parent 4ceaca8 commit db12a67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions extensions/model/classes/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
use \de\toxa\txf\data;


/**
* Implements basic behaviour of a model and its instances/items.
*
* @property-read integer|array id
*
* @package de\toxa\txf\model
*/
class model
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ $title = trim( $title ) !== '' ? ' title="' . html::inAttribute( $title ) . '"

$name = html::idname( $name, true );

echo view::wrapNotEmpty( $label, "<label for=\"$name\">|:</label>" );
echo view::wrapNotEmpty( $label, "<label for=\"checkbox-$name\">|:</label>" );

if ( $class ) {
$class = ' class="' . html::inAttribute( $class ) . '"';
}

?>
<span<?php echo $class ?>>
<input type="checkbox" class="checkbox" name="<?php echo $name ?>" value="<?php echo html::inAttribute( $value ) ?>"<?php echo $checked . $title ?>/>
<input type="checkbox" class="checkbox" name="<?php echo $name ?>" id="checkbox-<?php echo $name ?>" value="<?php echo html::inAttribute( $value ) ?>"<?php echo $checked . $title ?>/>
</span>

0 comments on commit db12a67

Please sign in to comment.