White page in index

Hi I have problem in using renderPartial, my index only shows white page or blank page.no error log.

SitController.php




  public function actionIndex()

    {

        $model = new LoginForm();


        $this->renderPartial('index', [

            'model' => $model,

        ]);

    }



views/site


<?php

use yii\helpers\Html;

use yii\widgets\ActiveForm;


/* @var $this yii\web\View */

/* @var $form yii\widgets\ActiveForm */

/* @var $model app\models\LoginForm */


$this->title = 'Login';

?>

<h1><?= Html::encode($this->title) ?></h1>


<p>Please fill out the following fields to login:</p>


<?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'username') ?>

    <?= $form->field($model, 'password')->passwordInput() ?>

    <?= Html::submitButton('Login') ?>

<?php ActiveForm::end(); ?>

can you help me please.

Thank you in advance.

Use: echo $this->renderPartial :)

you must use return in ur action:


 public function actionIndex()

    {

        $model = new LoginForm();


        return $this->renderPartial('index', [

            'model' => $model,

        ]);

    }

Thank you it’s working

@tvdavid,

It’s working too.