diff --git a/src/generators/crud/callbacks/yii/Html.php b/src/generators/crud/callbacks/yii/Html.php index 2b0ad187..5cd41ae3 100644 --- a/src/generators/crud/callbacks/yii/Html.php +++ b/src/generators/crud/callbacks/yii/Html.php @@ -13,7 +13,7 @@ public static function column() 'format' => 'html', 'attribute' => '{$attribute}', 'value'=> function(\$model){ - return html_entity_decode(\$model->{$attribute}); + return is_string(\$model->{$attribute}) ? html_entity_decode(\$model->{$attribute}) : \$model->{$attribute}; } ] FORMAT; @@ -28,7 +28,9 @@ public static function attribute() [ 'format' => 'html', 'attribute' => '{$attribute}', - 'value' => html_entity_decode(\$model->{$attribute}) + 'value'=> function(\$model){ + return is_string(\$model->{$attribute}) ? html_entity_decode(\$model->{$attribute}) : \$model->{$attribute}; + } ] FORMAT; }; diff --git a/tests/Makefile b/tests/Makefile index ed964919..232eb107 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,6 +1,6 @@ .PHONY: open bash test -DOCKER_COMPOSE ?= docker-compose +DOCKER_COMPOSE ?= docker compose PHP ?= phpfpm WEB ?= phpfpm