Very confused newbie

Hi Yii,

I found a simple guide online on how to install Yii2 and create a simple database app. I installed Yii2 basic into the web folder of EasyPHP having downloaded the .tgz file. After a couple of configuration issues, I got the message:

"Congratulations! You have successfully created your Yii-powered application."

Next, I created the simple dB with tbl_users in it and modified the config. to access the dB. I accessed Gii through localhost/yii/web/index.php?r=gii, selected ‘Model Generator’ and managed to create the model ‘TblUser’. So far, so good.

Now, what do I enter into the CRUD generator, etc, so I can view my dB’s records? I know this should be blinding obvious, but I can’t find a single. clear tutorial on how to do this.

Cheers

Gary

DId you try the Definitive Guide to Yii ?

Here is the Gii part, with examples for model and CRUD - http://www.yiiframework.com/doc-2.0/guide-start-gii.html#generating-crud

[color="#006400"]NOTE: moved to proper section (from Yii-powered applications)[/color]

Hi Maurizio,

Thanks for the fast reply. I have been through that guide. The only issue I had was when entering the CRUD generator view path. When I entered the path, all I got (on preview) was an error message so I had to generate with that box empty.

When I entered 127.0.0.1/yii/web/index.php?r=TblUser/index, I got a "Not Found (#404)" error message.

I installed Yii in a subdirectory off of EasyPHP’s web root. Is that OK?

Regards

Gary

Try with this url, if your controller name is TblUserController.php


127.0.0.1/yii/web/index.php?r=tbl-user/index

Or UserController.php, then remove the tbl from url


127.0.0.1/yii/web/index.php?r=user/index

Hi Selvakumar,

You genius! It worked. I can now view the entries and use their CRUD icons to edit, delete, etc. OK, now to figure out how to make a full application.

Many Thanks

Gary

First familiarize yourself with framework, then try to do something concrete.

Here are few tutorials:

Yii project structure

How to configure your Yii application

Working with Gii

How to login user from DB (make login functionality)

Cheers

Hi Duri,

Thanks for the tutorial links.

Much aoppreciated

Gary

Your welcome, I hope you enjoyed :)