?> <div id="SearchResultList"> <?php foreach ($datas as $data) { ?> <article> <h3 class="result-head"><?php $this->BcBaser->link($this->BcBaser->mark($query, $data['Content']['title']), $data['Content']['url']); ?> </h3> <p class="result-body"><?php echo $this->BcBaser->mark($query, $this->Text->truncate($data['Content']['detail'], 100)); ?> </p> <p class="result-link"><small><?php $this->BcBaser->link(fullUrl($data['Content']['url']), $data['Content']['url']); ?> </small></p> </article> </div> <?php } } else { ?> <div> <p class="no-data">該当する結果が存在しませんでした。</p> </div> <?php } ?>
/** * httpからのフルURLを取得する */ public function testFullUrl() { $this->assertRegExp('/\\//', fullUrl('/')); $this->assertRegExp('/\\/.*blog/', fullUrl('/blog')); $this->assertRegExp('/\\//', fullUrl(null)); }
/** * URLを取得する * * @param $url * @param bool $useSubDomain * @return string */ public function getUrl($url, $full = false, $useSubDomain = false) { if ($useSubDomain && !is_array($url)) { $subDomain = ''; $site = BcSite::findByUrl($url); $originUrl = $url; if ($site) { $subDomain = $site->alias; $originUrl = preg_replace('/^\\/' . preg_quote($site->alias, '/') . '\\//', '/', $url); } if ($originUrl == '/') { $urlArray = []; } else { $urlArray = explode('/', preg_replace('/(^\\/|\\/$)/', '', $originUrl)); } if (preg_match('/\\/$/', $url) && count($urlArray) > 0) { $originUrl .= '/'; } if ($full) { $fullUrl = fullUrl($originUrl); if (BcUtil::isAdminSystem()) { if ($site->domainType == 1) { $fullUrlArray = explode('//', $fullUrl); return $fullUrlArray[0] . '//' . $subDomain . '.' . $fullUrlArray[1]; } elseif ($site->domainType == 2) { $fullUrlArray = explode('//', $fullUrl); $urlArray = explode('/', $fullUrlArray[1]); unset($urlArray[0]); if ($site->sameMainUrl) { $mainSite = BcSite::findById($site->mainSiteId); $subDomain = $mainSite->alias; } return $fullUrlArray[0] . '//' . $subDomain . '/' . implode('/', $urlArray); } } else { return $fullUrl; } } else { return Router::url($originUrl); } } else { if (BC_INSTALLED) { if (!is_array($url)) { $site = BcSite::findByUrl($url); if ($site && $site->sameMainUrl) { $mainSite = BcSite::findById($site->mainSiteId); $alias = $mainSite->alias; if ($alias) { $alias = '/' . $alias; } $url = $alias . $site->getPureUrl($url); } } } if ($full) { return fullUrl($url); } else { return Router::url($url); } } }
echo $data['Content']['url']; ?> "> <div class="media-body"> <h2 class="media-title"><?php echo $this->BcBaser->mark($query, $data['Content']['title']); ?> </h2> <p class="media-excerpt"> <?php echo $this->BcBaser->mark($query, $this->Text->truncate($data['Content']['detail'], 100)); ?> ...<br> <span class="size-sm"><?php echo fullUrl($data['Content']['url']); ?> </span> </p> <!-- /.media-body --></div> </a> </div> <?php } ?> <!-- /.entry-summary --></div> <?php } else { ?> <div class="entry-summary">
?> .png" /></td> <td> <!-- Icons --> <a href="index.php/articles_item/edit/<?php echo $val['id']; ?> ?redirect=<?php echo base64_encode(fullUrl()); ?> " title="Edit"><img src="template/backend/simpla-admin/resources/images/icons/pencil.png" alt="Edit" /></a> <a href="index.php/articles_item/del/<?php echo $val['id']; ?> ?redirect=<?php echo base64_encode(fullUrl()); ?> " title="Delete"><img src="template/backend/simpla-admin/resources/images/icons/cross.png" alt="Delete" /></a> </td> </tr> <?php } } else { echo '<tr><td colspan="7">Không có dữ liệu</td></tr>'; } ?> <tbody> </tbody> </table> </form>
if ($datas) { ?> <?php foreach ($datas as $data) { ?> <div class="section"> <h3 class="result-head"><?php $this->BcBaser->link($this->BcBaser->mark($query, $data['SearchIndex']['title']), $data['SearchIndex']['url']); ?> </h3> <p class="result-body"><?php echo $this->BcBaser->mark($query, $this->Text->truncate($data['SearchIndex']['detail'], 100)); ?> </p> <p class="result-link"><small><?php $this->BcBaser->link(fullUrl($data['SearchIndex']['url']), $data['SearchIndex']['url']); ?> </small></p> </div> <?php } } else { ?> <div class="section"> <p class="no-data">該当する結果が存在しませんでした。</p> </div> <?php } ?> <div class="clearfix section">