Installing Symfony by composer
after composer installation then install the symfony. command in your shell:
php composer.phar create-project symfony/framework-standard-edition my_project_name
toolbar hide:
app > config > config_dev.yml
toolbar: false
Creating database:
database create by command follow the symfony documentation.
Creating an Entity Class:
command in your shell:
cd htdocs
cd eventmanage
php bin/console doctrine:generate:entity
The Entity shortcut name: AppBundle:Category
New field name(press <return> to stop adding fields): name
New field name(press <return> to stop adding fields): create_date
Field type[string]:datetime
Entity table relation:
Entity > fileName.php
/**
* @var int
*
* @ORM\ManyToOne(targetEntity=”Category”, inversedBy=”events”)
*/
private $category;
Creating the Database Tables/Schema
command in your shell:
php bin/console doctrine:schema:update –force
Fetching Data from Database:
follow the symfony documentation > guides > Databae(Doctrine ORM)
How to remove “web/app_dev.php” from Symfony URLs?
web > htaccess change base url
app.php
to
app_dev.php
How to change directory
http://localhost/eventmanage/web/app_dev.php
to
just cut all file from the web folder and past root folder then change app.php
/vendor/autoload.php’;
/var/bootstrap.php.cache’;