publichousenav.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. use yii\helpers\Url;
  3. use common\fm\Opencc;
  4. $module = Yii::$app->controller->module->id;
  5. if (!empty(Yii::$app->request->get('hid'))) {
  6. $name = \common\models\House::findOne(Yii::$app->request->get('hid'))['name'];
  7. $housenews = (new \common\models\News())->getHouseNews($name);
  8. }
  9. ?>
  10. <!-- 楼盘导航 -->
  11. <div style="height:25px;"></div>
  12. <div class="y_lpnav">
  13. <div class="y_lpnavmain puic_wid puic_color c">
  14. <ul class="c">
  15. <li <?php $hid = Yii::$app->request->get('hid'); if (strpos($_SERVER['REQUEST_URI'], 'house/' . $hid) > 0) echo 'class="on"' ?>>
  16. <a href="/house/<?= $hid ?>">
  17. <span><?= Opencc::ConvertHn('楼盘首页') ?></span>
  18. </a>
  19. </li>
  20. <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/details') > 0) echo 'class="on"' ?>>
  21. <a href="/house/details/<?= $hid ?>">
  22. <span><?= Opencc::ConvertHn('楼盘信息') ?></span>
  23. </a>
  24. </li>
  25. <?php if (!empty($housenews)) { ?>
  26. <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/news') > 0) echo 'class="on"' ?>>
  27. <a href="/house/news/<?= $hid ?>">
  28. <span><?= Opencc::ConvertHn('楼盘动态') ?></span>
  29. </a>
  30. </li>
  31. <?php } ?>
  32. <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/type') > 0) echo 'class="on"' ?>>
  33. <a href="/house/type/<?= $hid ?>">
  34. <span><?= Opencc::ConvertHn('楼盘户型') ?></span>
  35. </a>
  36. </li>
  37. <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/album') > 0) echo 'class="on"' ?>>
  38. <a href="/house/album/<?= $hid ?>">
  39. <span><?= Opencc::ConvertHn('楼盘相册') ?></span>
  40. </a>
  41. </li>
  42. </ul>
  43. </div>
  44. </div>