Zeka Posted March 7, 2017 Share Posted March 7, 2017 Hi. By $page->url(true) we can get a url with scheme and hostname. But $page->image_field->url(true); returns url without scheme and hostname. Is it expected behavior or just inconsistency between methods? How do you thinks, should these methods behave the same? Link to comment Share on other sites More sharing options...
kixe Posted March 7, 2017 Share Posted March 7, 2017 To get url with scheme and hostname use $page->image_field->httpUrl(); It maybe would make sense to provide modifying output of Pagefile::url() via arguments similar to Page::url() (just to mention: a page is not a file!) 2 Link to comment Share on other sites More sharing options...
Robin S Posted March 7, 2017 Share Posted March 7, 2017 2 hours ago, Zeka said: Is it expected behavior or just inconsistency between methods? I think you could say it is expected, as these are completely separate methods. The method $page->url() takes an options argument - when you pass 'true' as an argument you are actually setting the 'http' option: $page->url(['http' => true]); The method Pageimage::url() takes no options so passing 'true' or any other argument isn't going to modify the way the method works. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now