I have this code
<li id="Tiempo">
<?= $this->Html->link(__('En Tiempo'), ['action' => 'index', 'Tiempo']) ?><span class="label label-success ml-10"><?php echo $entiempo ?></span>
</li>
But i want the span into a but I don't know how
You have to modify the content/title of the link. As the docs point out, this is the first parameter of HtmlHelper->link(). To add the span inside your a tag you have 2 options.
You could either modify it directly and set the escape options to false:
<li id="Tiempo">
<?= $this->Html->link('<span class="label label-success ml-10">' . $entiempo . '</span>', ['action' => 'index', 'Tiempo'], ['escape' => false]) ?>
</li>
Or you modify the template HtmlHelper uses.
$this->Html->setTemplates([
'link' => '<a href="{{url}}"{{attrs}}><span class="label label-success ml-10">{{content}}</span></a>',
]);
and use the link() method like this:
<?= $this->Html->link($entiempo, ['action' => 'index', 'Tiempo']) ?>
lib/Cake/VERSION.txtorvendor/cakephp/cakephp/VERSION.txt) - thanks!