UnionOfRAD/lithium — pull request #290 by rmarscher (2012-01-23 23:06:00+00:00)
Title: Fixing inconsistency with paths in Media::type() option defaults

See issue #283 for discussion. If you look at the docs and defaults for Media::type, you'll see it has 'template' and 'layout' as top level items for the $options for defining a new media type. But, if you look at Media::_handlers, the 'default' type has 'template' and 'layout' as well as 'element' inside a 'paths' key.

I updated the defaults, api doc, and tests for Media::type to use a 'paths' key instead of 'template' and 'layout' keys. I made use of lithium\util\Set::merge to deep merging of the options so you don't need to redefine all paths if you just want to turn off the layout.

I originally wanted to preserve the 'template' and 'layout' keys for backwards compatibility... but it seems to be that they weren't working anyway, so this has been broken for some time if it was ever working at all. If you disagree, let me know and I can look into it some more.

Thanks,
Rob