Symfony Components Quiz 2

Description

Quiz on Symfony Components Quiz 2, created by Adrian Caliman on 21/05/2015.
Adrian Caliman
Quiz by Adrian Caliman, updated more than 1 year ago More Less
Alexandra Negrea
Created by Alexandra Negrea almost 9 years ago
Adrian Caliman
Copied by Adrian Caliman almost 9 years ago
11
0

Resource summary

Question 1

Question
What functions can you call on an instance of \Symfony\Component\ClassLoader\ClassLoader, apart from the register() function?
Answer
  • $loader->addPrefix('Twig_', __DIR__.'/vendor/twig/twig/lib');
  • $loader->setUseIncludePath(true);
  • $loader->addPrefixes(array( 'Symfony' => __DIR__.'/../vendor/symfony/symfony/src', 'Monolog' => __DIR__.'/../vendor/monolog/monolog/src', ));
  • $loader->mapClass(Twig_', __DIR__.'/vendor/twig/twig/lib');

Question 2

Question
What classes allow you to cache the mapping from a class to its containing file?
Answer
  • ApcClassLoader
  • AppClassLoader
  • XDebugClassLoader
  • XcacheClassLoader

Question 3

Question
How can you instantiate an ApcClassLoader?
Answer
  • new ApcClassLoader($loader, sha1(__FILE__));
  • new ApcClassLoader($loader);
  • new ApcClassLoader(sha1(__FILE__), $loader);
  • new ApcClassLoader('../app/cache', $loader);

Question 4

Question
Two class loaders can co-exist in the application?
Answer
  • True
  • False

Question 5

Question
How many classes does the class loader component have?
Answer
  • Less than 10
  • About 20
  • More than 40

Question 6

Question
you can define a new file loader in Symfony, if the new loader class :
Answer
  • is registered in yml as a service with the config.file_loader tag
  • is registered with the DelagatingLoader
  • implements the LoaderInterface
  • extends the abstract FileLoader class

Question 7

Question
You should merge all your configuration files into one and use it as cache.
Answer
  • True
  • False

Question 8

Question
What class in the Config Component helps you manage and check if the generate cache file containing all the configuration is valid and if not regenerate it?
Answer
  • CacheConfig
  • ConfigurationCache
  • ConfigLoaderCache
  • ConfigCache

Question 9

Question
In the context of a TreeBuilder, which of the following are valid node types?
Answer
  • string
  • scalar
  • array
  • enum
  • serviceId
  • integer
  • boolean
  • float
  • parameter
  • variable

Question 10

Question
Which of the following are valid ways to define a scalar node type? (to replace .... below) $treeBuilder ->children() ..... ->end();
Answer
  • ->node('name', 'scalar')
  • ->scalarNode('name')
  • ->addScalarNode('name')
  • ->nodeName('scalar')

Question 11

Question
How do you disable automatic escaping for a section of the template?
Answer
  • {% escape false %} Content here {% end escape %}
  • {% autoescape false %} Content here {% endautoescape %}
  • {% not escape %} Content here {% end %}
  • {% autoescape %} Content here {% endautoescape %}
  • {% autoescape enabled = false %} Content here {% endautoescape %}
Show full summary Hide full summary

Similar

Flash messages
Elvis Moraes
Component Notes
Alexandra Negrea
Symfony Components
Alexandra Negrea
Symfony Certification
Nash Delos Santos
Cookbook Quiz
Alexandra Negrea
Physics equations
helensellers75
Economics - unit 1
Amardeep Kumar
Anatomy and Physiology - BIO 111 - Test #1 Flashcards
ajudkins
Unit 3 Business Studies
Lauren Thrower
Sociology - Crime and Deviance - Feminists
josaul1996
Core Spring 4.2 Certification Mock Exam
antoine.rey