Symfony Documentation

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

http://localhost/eventmanage

just cut all file from the web folder and past root folder then change app.php
/vendor/autoload.php’;
/var/bootstrap.php.cache’;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s