Steps for a successful symfony living part 1
Suppose you have a mysql db somewhere. Lets make a very quick CRUD. As fast as possible ..
Requirements:
1) a glass of water,
2) a mysql db
3) the symfony sandbox
Here we go:
Step 1: edit config/databases.yml and use these as last lines:
param:
dsn: mysql://<username>:<password>@<host>/<database_name>
Step 2: edit config/propel.ini to set up propel properly:
propel.database = mysql
propel.database.createUrl = mysql://login:passwd@localhost
propel.database.url = mysql://login:passwd@localhost/database
propel.mysql.tableType = InnoDBsetting up is done now lets get to the fun part
Step 3: we create the model from the mysql db, type at your cli:
symfony propel-build-schema
Generating XML from Creole connection !
[propel-creole-transform] Propel – CreoleToXMLSchema finishedBUILD FINISHEDTotal time: 1.1212 second>> schema putting /var/www/localhost/htdocs/estate/config/schema.yml>> file- /var/www/localhost/htdocs/estate/config/schema.xml
symfony propel-build-model
symfony init-app backend
symfony propel-generate-crud backend images Image
Drink the glass of water. You are done now.