E
E
EVOSandru62015-01-12 07:25:38
Yii
EVOSandru6, 2015-01-12 07:25:38

Yii Chtml::tag, because of the output of a non-existent character?

Good afternoon,
I tried to display such a thing on the screen - the bootstrap icon.

CHtml::tag('i',array('class'=>'glyphicon glyphicon-user'),true)

The tag opens and closes, but in addition to the icon contains the symbol " 1 ", which is not registered there. What could be the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ivankomolin, 2015-01-12
@EVOSandru6

When calling the tag() method, the content of the tag is passed as the third parameter, but if a single tag is needed, then false can be passed.
Because you pass true then this value is automatically converted to 1 and printed as the content of the tag
---------------------------------- -------------------------------------------------- ------------------------------------
This code:
Will generate this:
------------------------------------------------ -------------------------------------------------- -----------------------
This code:
Will generate this:
------------------------------------------------ -------------------------------------------------- ----------------------

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question