M
M
Messi2018-04-19 07:37:54
Yii
Messi, 2018-04-19 07:37:54

How to pass a link correctly?

The link field (string(2048)) is stored in the database.
In the view, I add a link to the a tag.

<?= Html::a(ссылка, $myObject->link, ['target'=>'_blank'])?>

Problem:
If you insert a link like this:
https://toster.ru/
then the link will open the site "toaster", and if you insert it like this:
toster.ru
it opens https:
//my-domain.loca/toster.ru , please, how to make it so that, regardless of the type of link, sites (though not correct ones) open without my domain?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Mashletov, 2018-04-19
@FitTech

Add // - //toster.ru
Or store the full url with http.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question