B
B
BonBon Slick2018-02-10 14:04:28
YAML
BonBon Slick, 2018-02-10 14:04:28

How to understand when to use quotes, brackets in .yaml configuration?

It is not entirely clear when to use and when not, it seems like they work the same way.
Example:

#https://symfony.com/doc/current/reference/configuration/framework.html#configuration

imports:
    - { resource: '../parameters_dev.yaml' }

imports:
    - { resource: ../parameters_dev.yaml }

the same with
validation:
        enabled: true 
// или
     enabled: 'true'

and so on, does it affect what? If not, then why put or not put brackets?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2018-02-10
@BonBonSlick

symfony.com/doc/current/components/yaml/yaml_forma...
From myself, I’ll say, true repeat your example c with false, then it will most likely become clear to you why this is needed ...
In PHP, the string, if not empty and not '0', then it true
returns php.net/manual/en/language.types .boolean.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question