Created
August 24, 2017 15:33
-
-
Save init90/a594bc8288fa16d0c3b0a851fb48f665 to your computer and use it in GitHub Desktop.
drupal 8, link validate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $post_codes_base_link = ''; | |
| $post_code_description = $this->house->get('field_postcode')->getDataDefinition()->getDescription(); | |
| if (UrlHelper::isValid($post_code_description, TRUE)) { | |
| $post_codes_base_url = \Drupal\Core\Url::fromUri($post_code_description); | |
| $post_codes_base_url->setOptions(['attributes' => ['target' => 'blank']]); | |
| $post_codes_base_link = \Drupal\Core\Link::fromTextAndUrl( | |
| t('Lithuania postcodes base'), | |
| $post_codes_base_url | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment