Symfony Flashcards
is symfony a full framework?
No it starts as a microframework then it builds up to be a frame work
how to make a new symfony project?
composer create-project symfony/skeleton name
what is index.php in the public folder?
it’s the front controller it’s a file that gets executed when you go to any url
what is a route?
configuration that defines the url of a page
what is a controller
a function that builds the content of the page
what is the rule of a controller method?
it must return a symfony response object
what is a slug?
it’s a url version of the title
what are the benefits of flex?
aliases
recipes
what are the aliases for flex?
it’s just a shortcut for the name of the bundle
what is a recipe for flex?
it is executed by flex to add files or create directories or even modify files so that the bundle works without anymore config
what is symfony.lock?
it’s a file managed by flex and keeps track of what recipes have been installed
what is bundles.php
it’s a file that has all the third party bundles that work with symfony
what is the AbstarctController
it’s a class that gives the controller shortcuts to methods and u don’t have to extend from it
how to return a template?
$this->render(templateName , array( title => $title))
what is the syntax of twig?
{{}} say something as it prints like a variable ora string or have logic in it like name = no ?? yes
{%%} do something
{##} comment
how to for loop in twig?
{% for comment in comments %}
{% endfor %}
how to inherit in twig?
{% extends ‘base.html.twig’ %}
what is the filter to get the length in twig?
comments | length
what happens when u tell twig to extend another template?
that u want to put your template inside of that template and the block are the holes where we can put our child template
how to put your content inside of a twig block?
{% block body %}
{% endblock %}
can u give the blocks in twig a default ?
yes and u can then override it
where can u use dump() from the profiler bundle?
ianywhere even twig {{ dump() }}
what is a pack?
it’s a single file that installs a bunch of other bundles in the same step
how to unpack a pack?
composer unpack name