Yii Framework Forum: Ways To Start A New Project - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ways To Start A New Project Rate Topic: -----

#1 User is offline   checkout101 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 24-November 12

Posted 26 November 2012 - 01:20 AM

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?
0

#2 User is offline   Rajith R 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 873
  • Joined: 20-April 11
  • Location:India

Posted 26 November 2012 - 02:58 AM

View Postcheckout101, 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?



yes, use GII . create an app first then use gii to create models/controllers/views
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
0

#3 User is offline   Rajith R 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 873
  • Joined: 20-April 11
  • Location:India

Posted 26 November 2012 - 02:59 AM

View Postcheckout101, 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?



yes, use GII . create an app first then use gii to create models/controllers/views
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
0

#4 User is offline   checkout101 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 24-November 12

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. :)
0

#5 User is offline   Muaid 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 111
  • Joined: 25-October 10
  • Location:Saudi Arabia

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:

- 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 :)
0

#6 User is offline   checkout101 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 24-November 12

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.
0

#7 User is offline   usernametest1 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 07-December 12

Posted 07 December 2012 - 06:21 AM

deleted
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users