Thứ Hai, 26 tháng 10, 2015

Symfony 2: create a simple PHP app step by step

1). Prepare
Install composer and check it is installed correctly.
link: https://getcomposer.org/
Install Netbeans
link:  https://netbeans.org/downloads/
Download Symfony 2.7
link: http://symfony.com/download?v=Symfony_Standard_Vendors_2.7.3.zip

2). Create new Symfony2 project
link: http://software-talk.org/blog/2012/06/symfony2-tutorial-netbeans-and-symfony2-setting-everything-up/

Follow the above link to create new Symfony2 project.
The project name is PhpProject1
The following link is linked to file which my project is compressed.
link gdrive: https://drive.google.com/file/d/0B3pK-GhBUdJLMGdkcUd6bVhqMFk/view?usp=sharing

3). Commands

Create bundle
php app/console generate:bundle --namespace=Acme/BlogBundle --dir=src --no-interaction

*DB:
Create DB
php app/console doctrine:database:create

Create table
php app/console doctrine:schema:create 
Error:No Metadata Classes to process
FIX: php app/console doctrine:schema:update --force

Generate setter and getter methods
php app/console doctrine:generate:entities
or create one entity
php app/console doctrine:generate:entity --entity=AcmeBlogBundle:Page --format=annotation --fields="title:string(255) body:text" --no-interaction


4). Tutorial
Link: http://tutorial.symblog.co.uk/
Follow the above link to create a simple blog by Symfony2.


Continue ...


- Comments

0 nhận xét:

Đăng nhận xét