Skip to content

Tweak to Absolute URL generation #3693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 19, 2014
Merged

Tweak to Absolute URL generation #3693

merged 2 commits into from
Mar 19, 2014

Conversation

weaverryan
Copy link
Member

Q A
Doc fix yes
New docs no
Applies to 2.3
Fixed tickets #3573

This updates how we describe URL generation. After #3573, it occurs to me that if you're looking here for a reference, you'll look for the first spot where absolute URLs are discussed and try to use it. So why not put the controller/PHP version and template version of doing this in the same spot.

Cheers!

This is so we have the controller/PHP version and template version in the same spot. See #3573

I also made a few other tweaks, including using generateUrl (like we did earlier) to generate
the absolute URL, not going through the router service directly.
@weaverryan weaverryan mentioned this pull request Mar 18, 2014
a controller, simply pass ``true`` to the third argument of the ``generateUrl()``
method::

$this->getgenerateUrl('blog_show', array('slug' => 'my-blog-post'), true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the get from getgenerateUrl

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, are you sure? Just kidding - thanks for catching that ;)

@xabbuh
Copy link
Member

xabbuh commented Mar 19, 2014

👍

@weaverryan
Copy link
Member Author

Thanks for the sanity check as always @xabbuh :)

weaverryan added a commit that referenced this pull request Mar 19, 2014
This PR was merged into the 2.3 branch.

Discussion
----------

Tweak to Absolute URL generation

| Q | A |
|----------------|------|
| Doc fix | yes |
| New docs | no |
| Applies to | 2.3 |
| Fixed tickets | #3573  |

This updates how we describe URL generation. After #3573, it occurs to me that if you're looking here for a reference, you'll look for the first spot where absolute URLs are discussed and try to use it. So why not put the controller/PHP version and template version of doing this in the same spot.

Cheers!

Commits
-------

007a54f Fixing typo thanks to @xabbuh
873706c Moved the section about generating absolute URLs down
@weaverryan weaverryan merged commit 007a54f into 2.3 Mar 19, 2014
@wouterj wouterj deleted the absolute-urls branch March 19, 2014 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants