Do you guys always use the testdrive demo when creating a new project? Or is it possible to start completely from scratch? If so, what are the minimum required files? Testdrive creates lots of files and folders while some even empty, so I'm having a hard time traversing the directories.
Also, do you use Gii?
Page 1 of 1
Ways To Start A New Project
#2
Posted 26 November 2012 - 02:58 AM
checkout101, on 26 November 2012 - 01:20 AM, said:
Do you guys always use the testdrive demo when creating a new project? Or is it possible to start completely from scratch? If so, what are the minimum required files? Testdrive creates lots of files and folders while some even empty, so I'm having a hard time traversing the directories.
Also, do you use Gii?
Also, do you use Gii?
yes, use GII . create an app first then use gii to create models/controllers/views
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
Wiwo inc.
| Mobile: 919995504508
#3
Posted 26 November 2012 - 02:59 AM
checkout101, on 26 November 2012 - 01:20 AM, said:
Do you guys always use the testdrive demo when creating a new project? Or is it possible to start completely from scratch? If so, what are the minimum required files? Testdrive creates lots of files and folders while some even empty, so I'm having a hard time traversing the directories.
Also, do you use Gii?
Also, do you use Gii?
yes, use GII . create an app first then use gii to create models/controllers/views
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
Wiwo inc.
| Mobile: 919995504508
#4
Posted 27 November 2012 - 11:16 PM
So when you guys start a new project you always have to start from the testdrive demo and then work on from there?
Since I'm still a newbie to Yii, I'm overwhelmed by the amount of files generated by the demo. Anyway, thanks.
Since I'm still a newbie to Yii, I'm overwhelmed by the amount of files generated by the demo. Anyway, thanks.
#5
Posted 28 November 2012 - 04:08 AM
the demo app generated using command-line sometimes confuse newcomers because it demonstrate a fairly amount of necessary features that Yii has.
any way the very basic yii application contains only 2 files (and one folder).
for very basic hello world application you need only 1 Controller and 1 action to handle the request,,, so do not use command line tool to generate the demo, but let us do this just by creating 'myApplication' folder under WEBROOT with the following structure:
index.php will be :
and the SiteController.php wil be :
that is it !! then you can access your site: http://YOUR-DOMAIN/myApplication
Hello World !! should appear.
i hope this will help you and others whom may need this little tip for better understanding how Yii works.
for any other explaination dont hesitate to ask
any way the very basic yii application contains only 2 files (and one folder).
for very basic hello world application you need only 1 Controller and 1 action to handle the request,,, so do not use command line tool to generate the demo, but let us do this just by creating 'myApplication' folder under WEBROOT with the following structure:
- WEBROOT
+ framework //----> this is the main yii application folder
- myApplication
- controller
SiteController.php
index.php
index.php will be :
<?php $yii=dirname(__FILE__).'/../framework/yii.php'; $config = array( 'basePath'=>dirname(__FILE__), ); require_once($yii); Yii::createWebApplication($config)->run(); ?>
and the SiteController.php wil be :
<?php
class SiteController extends CController
{
public function actionIndex()
{
echo "Hello World !!";
}
}
?>that is it !! then you can access your site: http://YOUR-DOMAIN/myApplication
Hello World !! should appear.
i hope this will help you and others whom may need this little tip for better understanding how Yii works.
for any other explaination dont hesitate to ask
#6
Posted 30 November 2012 - 01:35 AM
Okay thank you! That's exactly the answer I'm looking for. Anyway, I'm really having headaches because of the volume of files I need to work with.
Share this topic:
Page 1 of 1

Help














