yii1 anchor tag

To create an anchor tag in Yii 1, you can use the CHtml::link() method. This method generates an HTML anchor tag with the specified link text and URL.

Here is an example of how to use CHtml::link() in Yii 1:

<?php
echo CHtml::link('Click here', array('controller/action'));
?>

In this example, the link text is "Click here", and the URL is specified using an array format. The array consists of the controller and action names. You can replace 'controller/action' with the appropriate controller and action names for your application.

The CHtml::link() method also allows you to specify additional HTML attributes for the anchor tag. For example, if you want to add a CSS class to the anchor tag, you can pass an array as the third parameter to CHtml::link(), like this:

<?php
echo CHtml::link('Click here', array('controller/action'), array('class' => 'my-link'));
?>

In this example, the anchor tag will have a CSS class of "my-link".

That's how you can create an anchor tag in Yii 1 using CHtml::link().