在cakephp中创建具有不同链接的多个LI标记

时间:2015-04-23 07:50:29

标签: php html cakephp

如何在li中创建具有相同样式的多个cakephp元素?这是我尝试使用cakephp获取的代码。

<ul class="z-nav__list-secondary">
    <li class="z-nav__item"><a class="z-nav__link" href="blog.html">Blog with sidebar</a></li>
    <li class="z-nav__item"><a class="z-nav__link" href="blog-full.html">Blog fullwidth</a></li>
    <li class="z-nav__item"><a class="z-nav__link" href="blog-masonry.html">Blog masonry</a></li>
    <li class="z-nav__item"><a class="z-nav__link" href="blog-timeline.html">Blog timeline</a></li>
    <li class="z-nav__item"><a class="z-nav__link" href="single-post.html">Single post with sidebar</a></li>
    <li class="z-nav__item"><a class="z-nav__link" href="single-post-full.html">Single post fullwidth</a></li>
    <li class="z-nav__item"><a class="z-nav__link" href="blog-audio.html">Blog audio</a></li>
    <li class="z-nav__item"><a class="z-nav__link" href="blog-video.html">Blog video</a></li>
    <li class="z-nav__item"><a class="z-nav__link" href="blog-author.html">Post author</a></li>
</ul>

1 个答案:

答案 0 :(得分:0)

您可以使用以下代码:

     - Html-&gt;链接(&#39;博客与侧边栏&#39;,数组(&#39;控制器&#39;    =&GT;&#39;页面&#39;&#39;动作&#39; =&GT; &#39;博客&#39),阵列(&#39;类&#39; = GT;&#39; Z-nav__link&#39;)); ?&GT;
  • Html-&gt;链接(&#39; Blog fullwidth&#39;,数组(&#39;控制器&#39; =&gt;&#39;页面&#39;,&#39;操作&#39; = &gt;&#39; blog-full&#39;),数组(&#39; class&#39; =&gt;&#39; z-nav__link&#39;)); ?&GT;
  • Html-&gt;链接(&#39; Blog砌体&#39;,数组(&#39;控制器&#39; =&gt;&#39;页&#39;,&#39;动作&#39; = &gt;&#39; blog-masonry&#39;),数组(&#39; class&#39; =&gt;&#39; z-nav__link&#39;)); ?&GT;
  • Html-&gt;链接(&#39;博客时间线&#39;,数组(&#39;控制器&#39; =&gt;&#39;页面&#39;,&#39;动作&#39; = &gt;&#39; blog-timeline&#39;),数组(&#39; class&#39; =&gt;&#39; z-nav__link&#39;)); ?&GT;
  • Html-&gt;链接(&#39;带有侧边栏的单个帖子&#39;,数组(&#39;控制器&#39; =&gt;&#39;页面&#39;&#39;行动&#39; ; =&gt;&#39;单一帖子&#39;),数组(&#39;类&#39; =&gt;&#39; z-nav__link&#39;)); ?&GT;
  • Html-&gt;链接(&#39;单个帖子全文&#39;,数组(&#39;控制器&#39; =&gt;&#39;页面&#39;&#39;动作&#39; =&gt;&#39;单后填充&#39;),数组(&#39; class&#39; =&gt;&#39; z-nav__link&#39;)); ?&GT;
  • Html-&gt;链接(&#39;博客音频&#39;,数组(&#39;控制器&#39; =&gt;&#39;页面&#39;,&#39;动作&#39; = &gt;&#39; blog-audio&#39;),数组(&#39; class&#39; =&gt;&#39; z-nav__link&#39;)); ?&GT;
  • Html-&gt;链接(&#39;博客视频&#39;,数组(&#39;控制器&#39; =&gt;&#39;页面&#39;,&#39;动作&#39; = &gt;&#39; blog-video&#39;),数组(&#39; class&#39; =&gt;&#39; z-nav__link&#39;)); ?&GT;
  • Html-&gt;链接(&#39;发布作者&#39;,数组(&#39;控制器&#39; =&gt;&#39;页面&#39;,&#39;操作&#39; = &gt;&#39; blog-author&#39;),array(&#39; class&#39; =&gt;&#39; z-nav__link&#39;)); ?&GT;
  • 编辑您的routes.php

    Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display','blog'));
    

    在Pages目录中创建所有文件。 ctp扩展名 我正在使用cakephp2.6