Home | 简体中文 | 繁体中文 | 杂文 | Search | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 作品与服务 | Email

9.2. DevTools

9.2.1. 创建项目

# phalcon project --help

Phalcon DevTools (2.0.7)

Help:
  Creates a project

Usage:
  project [name] [type] [directory] [enable-webtools]

Arguments:
  help	Shows this help text

Example
  phalcon project store simple

Options:
 --name               Name of the new project
 --enable-webtools    Determines if webtools should be enabled [optional]
 --directory=s        Base path on which project will be created [optional]
 --type=s             Type of the application to be generated (micro, simple, multi-module)
 --template-path      Specify a template path [optional]
 --use-config-ini     Use a ini file as configuration file [optional]
 --trace              Shows the trace of the framework in case of exception. [optional]
 --help               Shows this help

			

创建test项目

# phalcon project test

Phalcon DevTools (2.0.7)

  Success: Controller "index" was successfully created.
  Success: Project "test" was successfully created.
			

[root@netkiller example.com]# phalcon project www.example.com

Phalcon DevTools (2.0.7)


  Success: Controller "index" was successfully created.


  Success: Project "www.example.com" was successfully created.


[root@netkiller example.com]# find www.example.com/
www.example.com/
www.example.com/app
www.example.com/app/logs
www.example.com/app/views
www.example.com/app/views/index
www.example.com/app/views/index/index.phtml
www.example.com/app/views/layouts
www.example.com/app/views/index.phtml
www.example.com/app/config
www.example.com/app/config/config.php
www.example.com/app/models
www.example.com/app/controllers
www.example.com/app/controllers/ControllerBase.php
www.example.com/app/controllers/IndexController.php
www.example.com/public
www.example.com/public/img
www.example.com/public/css
www.example.com/public/temp
www.example.com/public/files
www.example.com/public/js
www.example.com/public/index.php
www.example.com/public/.htaccess
www.example.com/.phalcon
www.example.com/.htaccess
www.example.com/index.html

			

9.2.2. 创建控制器

# phalcon controller sample

Phalcon DevTools (2.0.7)

  Success: Controller "sample" was successfully created.			
			
			
# cat app/controllers/SampleController.php
<?php

class SampleController extends \Phalcon\Mvc\Controller
{

    public function indexAction()
    {

    }

}
			
			
comments powered by Disqus