Showing Another Page On The Index.php

Hello everyone,

I’m new to Yii and started to make a web application. I already found out where I can change e.g. the CSS to make the index.php which comes with Yii looks like how I wanted it. I also found out where I can change the navigation. And here starts my problem.

I already have a folder "users" where my "create.php" is located. I want to do this:

When someone opens my web application I want to show the “create.php” so the can register directly. I watched a tutorial where someone redirects the login page on the “index.php” so people who open the web application see the login form. I tried this with the “create.php” but it doesn’t work. The reason for that is because “crate.php” is in the folder “users” and not like the “login.php” in the folder “site”. I also tried to copy the “create.php” into the “users” folder but that doesn’t work.

Actually I get this error:

5928

Error.png

I would like to know what I could do to see the "create.php" on my "index.php"?

Thanks to everyone who tries to help me.

you could redirect the user to users/create just change your site index action as following




 public function actionIndex()

    {

$this->redirect(['users/create']);

    }

In order to have the create.php page you have to have the model of the new user (e.g. User.php) and the corresponding controller (e.g. UserController.php). Then create the action actionCreate() inside UserController, and inside actionIndex() of SiteController use




$this->redirect(array('user/create'));



on desired condition.