Giter Site home page Giter Site logo

eventcalender-symfony's Introduction

eventcalender-symfony

This is a project using symfony, for add, remove, manage events based on categories.

objectives

I am trying to achieved best cut edge understanding of symfony framework. Trying to figure out, how easy to develop a website or webservices using framework. In which case this is best for use.

Framworks

Install

$ php -r "file_put_contents('symfony', file_get_contents('https://symfony.com/installer'));"

Create project

$ php symfony new eventcalender-symfony 3.4

OR

$ composer create-project symfony/skeleton my_project_name

  • bootstrap v4.1.0 install
$ composer require twbs/bootstrap:4.1.0

uninstall

$ composer remove twbs/bootstrap

Composer list commands

$ composer list

TWIG Template

Twig is a php template engine that is used by symfony, just like most of others, i.e. blade, Mustache, Smarty, handlebars, etc.

base file

<html>
<head>
  <title>{% block title %}Welcome!{% endblock %}</title>
  {% block stylesheets %}{% endblock %}
</head>
<body>
  <header><header>
  <div class="container">
     {% block body %}{% endblock %}
  </div>
  <footer></footer>
  {% block javascripts %}{% endblock %}
</body>
</html>

router action file

<!-- include base template -->
{% extends 'base.html.twig' %}

<!-- this content replaced with body -->
{% block body %}
<div class="card">
    <div class="card-header">
        <h2 class="card-title">Title</h2>
    </div>
    <div class="card-body">
        <p>Welcome to Event Calender</p>
    </div>
</div>
{% endblock %}

<!-- style block replacement -->
{% block stylesheets %}
<style>
	body{font:'Verdana' 20px;}
</style>
{% endblock %}

Database Configuration

Folder app/config/parameters.yml change database_name, database_user, database_password.
We can use doctrine for creating database and tables. Doctrine is a basically a ORM that interact with database.

$ php bin/console doctrine:database:create
Created database `eventcalender-symfony` for connection named default

For tables, we have to create an Entity File. for more help you can search google 'symfony doctrine' for extra commands.

$ php bin/console doctrine:generate:entity
The Entity shortcut name: AppBundle:Entity_Name

Generate tables in database based on schema or Entity we generate

$ php bin/console doctrine:schema:update --force
Updating database schema...
Database schema updated successfully! "1" query was executed

eventcalender-symfony's People

Contributors

sorabh86 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.