本文描述 Symfony 1.x(1.0 ~ 1.4)專案建立流程。Symfony 2 起改用 composer create-project 與 make:bundle,架構差異極大,請勿混用。
article、user、cart)。index、show、edit)。apps/ batch/ cache/ config/ data/ doc/ lib/ log/ test/ web/
web/ index.php # 生產環境 frontend_dev.php # 開發環境
dev、test、prod),對應不同設定檔(settings.yml、databases.yml)。actions/ config/ lib/ templates/ validate/
立即可訪問:https://localhost/frontend_dev.php/article(預設顯示 templates/indexSuccess.php)。
symfony 指令底層為 Pake(PHP 版 Rake)。查看所有任務:
ServerName myapp.example.com DocumentRoot "/home/steve/myproject/web" DirectoryIndex index.php Alias /sf /usr/local/lib/php/data/symfony/web/sf AllowOverride All Allow from All
mod_rewrite 以支援美化網址。Alias /sf 指向 Symfony 核心資源目錄(Web Debug Toolbar、預設樣式等)。小結
symfony -T 可查詢所有指令。