Issue 1:
This is a small new feature/improvement.

If you have in parameters.yml a parameter as Array :

database:
blog:
host: blog-host
name: blog-name
store:
host: store-host
name: store-name

You can retrieve the parameter from a container

$container->getParameter('database');

However, there is no way to use that parameter from a config.yml definition, for instance (as an example) this parameter is not usuable to feed a doctrine connection.

doctrine:
dbal:
connections:
blog:
driver: %database_driver%
host: %database[blog][host]% #Doesn't work
port: %database_port%
dbname: %database[blog][name]% #Doesn't work
store:
driver: %database_driver%
host: %database[store][host]% #Doesn't work
port: %database_port%
dbname: %database[store][name]% #Doesn't work

Some people were looking for this feature on stackoverflow

http://stackoverflow.com/questions/19919679/symfony2-how-to-read-parameters-array-in-config-yml

Issue 2:
Currently an optional variable (that has a default and can be left out from matching and generating URLs) can only be specified without any text suffix, i.e. at the end of the pattern. This is quite limiting.

@laszlokorte and I propose to add the possibility to mark the optional parts with parentheses/curly brackets.

This can be implemented BC and would allow several new, but common use-cases, e.g.:

one can specify optional variables anywhere in the pattern (not only at the end),

one can use more than one char as seperator,

an optional part that depends on multiple variables,

flexiblity of where, what and whether there is a (trailing) seperator (see #5918).

Examples:

/products(-by-{criterion}).html would either match /products.html with criterion = default or /products-by-price.html with criterion = 'price'

/products(/{category}(.{_format})) would be equivalent to how we already handle /products/{category}.{_format} with defaults for both variables. It matches /products, /products/shoes and /products/shoes.html. But it does not match /products.html! Compare that to

/products((/{category}).{_format}) (only brackets changed) where the format would match without category, but the category does not match without the format. So the inner part requires the outer part to match.

/products(-in-{category})(-by-{criterion}).html matches /products.html and /products-in-shoes-by-prize.html and /products-in-shoes.html and /products-by-prize.html.

/products(-in-{category1}-and-{category2}).html only matches the optional part when both variables match, so /products-in-shoes-and-suits.html and /products.html, but not /products-in-shoes.html.

/products(-by-price).html should either raise exception that there is no variable in it, or treat it as-is (with the parentheses). It must not match both /products.html and /products-by-prize.html (where you should usually specify 2 routes for it) because there would be no way to decide which URL to generate.

/products/({category}) would match /products/ and /products/... whereas without the parentheses it would match /products and /products/... (see #5869)

/{product}((-by-{criterion}).{_format}) would need a default requirement for product to be [^/-\.]++ (so as seperator both / (standard) and - and .. Pretty hard to compile.

Also, it should raise an exception when you specify an optional part explicitly without adding a default for the variable in it.

This feature request is somewhat related to #5129 and also covers #5869 and #10217 and #9981