CakePHP链接和标记

CakePHP链接和标记,cakephp,hyperlink,tags,Cakephp,Hyperlink,Tags,我正在使用CakePHP。到目前为止,我无法将段落标记和CakePHP链接组合在一行中。链接继续在另一行中打印 到目前为止,我已经尝试过这些: <?php $arr = array('<p>Please download the file ', $this->Html->link('here', array('controller' => 'users', 'action' => 'download')), '</p>');

我正在使用CakePHP。到目前为止,我无法将段落标记和CakePHP链接组合在一行中。链接继续在另一行中打印

到目前为止,我已经尝试过这些:

<?php
    $arr = array('<p>Please download the file ', $this->Html->link('here', array('controller' => 'users', 'action' => 'download')), '</p>');
    echo join(" ", $arr);
?>

<?php echo '<p>Please download the file ' .  $this->Html->link('here', array('controller' => 'users', 'action' => 'download')) . '</p>'; ?>

对于段落或任何其他HTML标记,可以使用HtmlHelper的。这样把它们放在一起:

echo $this->Html->tag('p',
    'Please download the file ' .
    $this->Html->link('here', array(
        'controller' => 'users',
        'action' => 'download'
    ))
);

你期望的结果是什么?结果总是链接被打印在另一行中。我希望你的css打破它。。你在我的cakphp脚本中运行了你的代码,它运行得很好。。所以,请检查您的css是否为元素设置了宽度或等效宽度。我怀疑这是我的css。我没有使用任何“id”或“class”元素。您不能使用。。但它可以由父元素控制。如果div内的跨距可以由div属性控制。用你的萤火虫。