Is it possible to get a value from view.yml in an action

橙三吉。 提交于 2019-12-04 17:10:54

If you want to access the current Module's Config, you can use:

sfViewConfigHandler::getConfiguration(array(dirname(__DIR__) . '/config/view.yml'));

It should return something like this:

Array
(
[indexSuccess] => Array
    (
        [javascripts] => Array
            (
                [0] => mission-control.js
            )

        [stylesheets] => Array
            (
                [0] => control-box.css
                [1] => question.css
            )

    )

[newSuccess] => Array
    (
        [javascripts] => Array
            (
                [0] => box-checker.js
                [1] => topic.js
            )

        [stylesheets] => Array
            (
                [0] => question.css
                [1] => topic.css
            )

    )

[searchSuccess] => Array
    (
        [javascripts] => Array
            (
                [0] => topic.js
            )

        [stylesheets] => Array
            (
                [0] => topic.css
            )

    )

[showSuccess] => Array
    (
        [javascripts] => Array
            (
                [0] => mission-control.js
            )

        [stylesheets] => Array
            (
                [0] => control-box.css
                [1] => question.css
            )

    )

[editSuccess] => Array
    (
        [javascripts] => Array
            (
                [0] => box-checker.js
                [1] => topic.js
            )

        [stylesheets] => Array
            (
                [0] => question.css
                [1] => topic.css
            )

    )

[all] => Array
    (
        [stylesheets] => Array
            (
            )

        [javascripts] => Array
            (
            )

    )

)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!