I’m using the basic template on Linux Mint 20 and am trying to get a CRUD working. I have been unable to get the database connection using the tutorial code - which is excellent upto this point, so have tried gii.
The CRUD generator gives me this output:
indent preformatted text by 4 spaces
Generating code using template “/var/www/html/basic/vendor/yiisoft/yii2-gii/src/generators/crud/default”…
generated controllers/CountryController.php
generated models/CountrySearch.php
generated views/country/_form.php
generated views/country/_search.php
generated views/country/create.php
skipped views/country/index.php
generated views/country/update.php
generated views/country/view.php
done!
indent preformatted text by 4 spaces
but when I run : http://localhost/basic/web/index.php?r=country%2Findex
I get:
syntax error, unexpected end of file
in /var/www/html/basic/controllers/CountryController.php at line 43– yii\base\Controller::render()
which has this code:
public function actionIndex()
{
$searchModel = new CountrySearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
Any ideas what the generator is generating wrongly?
PB