PHP HTML foreach目录链接无法正常工作

时间:2016-06-25 00:55:01

标签: php html arrays

我正在尝试在目录中创建每个php文件的html视图,我唯一不能做的就是从我上面收集的数组的值创建链接。没有错误,但链接不可点击。

<?php
      $peopledirectory = 'kb/people';

      if (! is_dir($peopledirectory)) {
            exit('Invalid diretory path');
      }

      $people = array();

      foreach (scandir($peopledirectory) as $person) {
          if ('.' === $person) continue;
          if ('..' === $person) continue;

          $people[] = $person;
        }

        var_dump($people);
?>


<main class="main-content">
    <div class="container">
        <ul class="gallery-filter">
            <li><a href="#" class="current" data-filter="*">All Intel</a>
            </li>
            <li><a href="#" data-filter=".people">People</a>
            </li>
        </ul>
        <ul class="gallery-list gallery-list__grid">
            <?php foreach($people as $key=>$value) { 
            echo'
                <li class="gallery-item people ' . $value . '">
                    <figure class="gallery-thumb">
                        <a href="' . $value . '"><img src="/assets/images/big_logo.png" alt="">
                        </a>
                    </figure>
                    <div class="gallery-caption">
                        <div class="gallery-caption-holder">
                            <div class="gallery-caption-inner1">
                                <div class="gallery-caption-inner2">

                                    <h5><a href="' . $value . '" style="color:#000;"></a></h5>
                                    <div class="gallery-excerpt" style="color:#000;">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <span class="date">
                <span class="date-inner">' . $value . '</span>
                        </span>
                    </div>
                </li>
                    '; } ?>
            </ul>
    </div>
</main>

0 个答案:

没有答案