Problems With The Testdrive Example

Hi,

I’m trying to create my first Yii application, step by step, with the testdrive example but i meet some problems.

Problem n° 1 :

The application works good but when i’m trying to go “localhost:800/testdrive/index.php?r=user”, this doesn’t work.

When i try with this url "localhost:800/testdrive/index.php/user", i can see the user page !

Problem n° 2 :

When i’m try to create a new user, i obtain an error CException : UserController cannot find the requested view “_form”.

Problem n° 3 :

When i add a row in my user table directy in the database and i test "localhost:800/testdrive/index.php/user", i obtain a PHP warning : require(): Filename cannot be empty

you may want to use


yiic create webapp testdrive

to create a new site instead of copy & paste from article, you may have better chance to get a working example

I have tested these 2 ways and the example doesn’t work in his integrality :

% php YiiRoot/framework/yiic.php webapp WebRoot/testdrive

==> //localhost/testdrive/index.php?r=user

Error 404

Unable to resolve the request "user".

% YiiRoot/framework/yiic webapp WebRoot/testdrive

==> //localhost/testdrive/index.php?r=user

Return to the index page

When i test your suggestion in adding “create”, the command doesn’t work :

% YiiRoot/framework/yiic create webapp WebRoot/testdrive

What is the proper method ?

sorry my bad, no ‘create’ in command.

your command to create webapp is right.

there is no user module by default, you have to add by yourself.

you may want to compare the webapp you created and yii demo blog to see what’s the different.

keep reading your book…