20分でSymfony@OSC名古屋
by n416 on Aug 10, 2010
- 1,105 views
Accessibility
Categories
Tags
Upload Details
Uploaded via SlideShare as OpenOffice
Usage Rights
© All Rights Reserved
Statistics
- Favorites
- 0
- Downloads
- 5
- Comments
- 2
- Embed Views
- Views on SlideShare
- 1,040
- Total Views
- 1,105
Listen 127.0.0.1:8080
<VirtualHost 127.0.0.1:8080>
DocumentRoot 'C:\sftest2/web'
DirectoryIndex index.php
<Directory 'C:/sftest2/web'>
AllowOverride All
Allow from All
</Directory>
Alias /sf C:\xampp/php/PEAR/data/symfony/web/sf
<Directory 'C:\xampp/php/PEAR/data/symfony/web/sf'>
AllowOverride All
Allow from All
</Directory>
</VirtualHost> 1 year ago Reply
#my.iniをutf8にして日本語対応に。
default-character-set = utf8
skip-character-set-client-handshake
#DBを生成
mysqladmin -uroot -p create sftest
#Symfonyディレクトリに移動
cd c:\sftest
#プロジェクトを生成
symfony generate:project sftest
#アプリケーションを生成
symfony generate:app frontend
#DB設定をSymfonyに行う
symfony configure:database 'mysql:host=localhost;dbname=sftest' root
#スキーマをSymfonyに設定する
SftestData:
connection: doctrine
tableName: sftest_data
columns:
id:
type: integer(8)
primary: true
autoincrement: true
sftest_key:
type: integer(8)
sftest_value:
type: string(255)
#モデルを生成
symfony doctrine:build --model
symfony doctrine:build-sql
#テーブルを生成
symfony doctrine:insert-sql
#フォームを生成
symfony doctrine:build-form
#データーモデルに紐付いたモジュールを生成
symfony doctrine:generate-module --with-show --non-verbose-templates frontend sftest sftestData
#確認
http://localhost:8080/frontend_dev.php/sftest
(Apacheの設定はすでにしてあるという設定です。)
#テンプレートを変えてみる
indexSuccess.phpのタイトルを変更
スライドに戻ります。
#ホームページを変えてみる
#http://localhost:8080/frontend_dev.php/sftest を
#http://localhost:8080/ にする。
#routing.yml
homepage:
url: /
param: { module: sftest, action: index }
#階層を作り出す
#http://localhost:8080/frontend_dev.php/sftest を
#http://localhost:8080/category にする。
#routing.yml
default:
url: /category/:module/:action/*
スライドに戻る。
#c:\sftest\webにデスクトップにおいてあるsampleディレクトリをコピー
#http://localhost:8080/sample
#で開けるか確認する
http://localhost:8080/sample
スライドに戻る 1 year ago Reply