G
G
garyk52017-02-01 20:21:29
Yii
garyk5, 2017-02-01 20:21:29

How to set up a link via YII2 syntax?

Hello. The site has a regular link, when clicked, a pop-up window with fields is displayed. This link has: its own text, class.
Here:

Html::a(Html::encode('Оформить заказ онлайн прямо сейчас'), '#inline4', ['class' => 'order fancybox now']) ?>

Task: set up the link also attribute: rel="nofollow".
Difficulties: I tried a bunch of options, but some kind of bug. Displayed either rel="nofollow", but resets the class / or class but does not display rel="nofollow". Relationship: whatever comes first in the syntax works.
Not a connoisseur of YII2 and its constructs. I can't understand what is the reason. Correct please.
Html::a(Html::encode ('Оформить заказ онлайн прямо сейчас'), '#inline4', ['rel' => 'nofollow'], ['class' => 'order fancybox now']) ?>

Here is the version where it is: link text, form link, rel=nofollow attribute (displayed) and class (formatting) not rendered.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-02-01
@garyk5

Html::a(Html::encode ('Оформить заказ онлайн прямо сейчас'), '#inline4', ['rel' => 'nofollow', 'class' => 'order fancybox now'])

everything is in the docs: www.yiiframework.com/doc-2.0/guide-helper-html.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question