mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
PHP type casting
This commit is contained in:
@ -636,7 +636,7 @@ class BaseHtml
|
||||
*/
|
||||
public static function radio($name, $checked = false, $options = [])
|
||||
{
|
||||
$options['checked'] = (boolean) $checked;
|
||||
$options['checked'] = (bool) $checked;
|
||||
$value = array_key_exists('value', $options) ? $options['value'] : '1';
|
||||
if (isset($options['uncheck'])) {
|
||||
// add a hidden field so that if the radio button is not selected, it still submits a value
|
||||
@ -678,7 +678,7 @@ class BaseHtml
|
||||
*/
|
||||
public static function checkbox($name, $checked = false, $options = [])
|
||||
{
|
||||
$options['checked'] = (boolean) $checked;
|
||||
$options['checked'] = (bool) $checked;
|
||||
$value = array_key_exists('value', $options) ? $options['value'] : '1';
|
||||
if (isset($options['uncheck'])) {
|
||||
// add a hidden field so that if the checkbox is not selected, it still submits a value
|
||||
|
@ -81,7 +81,7 @@ class BaseUrl
|
||||
*/
|
||||
public static function toRoute($route, $scheme = false)
|
||||
{
|
||||
$route = (array)$route;
|
||||
$route = (array) $route;
|
||||
$route[0] = static::normalizeRoute($route[0]);
|
||||
|
||||
if ($scheme) {
|
||||
|
Reference in New Issue
Block a user