Best practice to create absolute URLs with Zend framework?

前端 未结 5 1812
南笙
南笙 2021-02-01 23:26

Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from

5条回答
  •  梦谈多话
    2021-02-01 23:59

    In my applications, I keep a "baseUrl" in my application config and I assign that to registry on bootstrapping. Later I use the following View Helper to generate the URL:

    Benefit: I can make any change on all the URLs in the view from one place.

    Hope this helps.

提交回复
热议问题