URL link redirect Drupal8

Source: Internet
Author: User
Tags drupal

    • l()Is gone. Use \drupal\core\link for full link objects,--link object
      and \drupal\core\url for URL generation. ---generate URLs
    • drupal_goto()Is gone.  Use a redirectresponse, or the redirect () method in your controller. --Jump
    • ------------------https://dev.acquia.com/blog/generating-urls-and-redirects-in-drupal-8/22/02/2016/9626

Remember the previous time on drupal/core/url->tostring (true| FALSE) also tangled half a day
Actually, the documentation is very clear.
That is, if true, that returns an object, and many times we just need a string.

* @return String|\drupal\core\generatedurl
* A string URL.
* When $collect _bubbleable_metadata are TRUE, a Generatedurl object is
* Returned, containing the generated URL plus bubbleable metadata.

URL link redirect Drupal8

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.