当前位置: 首页>>代码示例>>PHP>>正文


PHP Items::FindByName方法代码示例

本文整理汇总了PHP中Items::FindByName方法的典型用法代码示例。如果您正苦于以下问题:PHP Items::FindByName方法的具体用法?PHP Items::FindByName怎么用?PHP Items::FindByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Items的用法示例。


在下文中一共展示了Items::FindByName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display_page_content

function display_page_content()
{
    $section_name = requestIdParam();
    $section = Sections::FindByName($section_name);
    $item_name = getRequestVarAtIndex(3);
    $item = Items::FindByName($item_name);
    $gallery = $item->getGallery();
    ?>

		<h1><?php 
    echo $item->display_name;
    ?>
</h1>
<?php 
    $next_item = $item->findNext($section);
    $prev_item = $item->findPrev($section);
    if ($prev_item) {
        echo "\t\t\t\t<a href=\"" . get_link("portfolio/item/{$section_name}/" . $prev_item->name) . "\">previous</a>\n";
    }
    if ($next_item) {
        echo "\t\t\t\t<a href=\"" . get_link("portfolio/item/{$section_name}/" . $next_item->name) . "\">next</a>\n";
    }
    echo $item->content;
    foreach ($gallery->get_photos() as $photo) {
        echo "<img src=\"/" . $photo->getPublicUrl() . "\" /><br />";
    }
}
开发者ID:highchair,项目名称:hcd-trunk,代码行数:27,代码来源:item.php

示例2: elseif

} elseif (CALENDAR_INSTALL && $var0 == CALENDAR_STATIC_AREA) {
    $page_title = "Event Calendar | " . SITE_NAME;
    $bodyclass = "calendar";
    if (getRequestVarAtIndex(5)) {
        $event = Events::FindById(getRequestVarAtIndex(5));
        $description = $event->get_excerpt(160);
        $page_title = $event->get_seo_title(" | Event Calendar | " . SITE_NAME);
        $bodyclass = "calendar single-event";
    } elseif (getRequestVarAtIndex(4)) {
        $page_title = "Event Calendar for " . date('F j, Y', mktime(0, 0, 0, $var3, getRequestVarAtIndex(4), $var2)) . " | " . SITE_NAME;
        $bodyclass = "calendar events-for-day";
    }
} elseif (PORTFOLIO_INSTALL && isset($area) && $area->is_portfolioarea()) {
    // With Item
    if (!empty($var2)) {
        $item = ITEM_ID_IN_URL ? Items::FindById($var2) : Items::FindByName($var2);
        $description = $item->get_excerpt(160);
        $page_title = $item->get_seo_title(" | " . $page->get_title() . " | " . $area->get_title() . " | " . SITE_NAME);
        $bodyclass = "portarea-{$area->id} section-{$page->id} single-item item-{$item->id}";
        // No item but a port area and section
    } elseif (isset($page)) {
        $description = $page->content != "" ? $page->get_excerpt(160) : $area->get_excerpt(160);
        $page_title = $page->get_seo_title(" | " . $area->get_title() . " | " . SITE_NAME);
        $bodyclass = "portarea-{$area->id} section-landing section-{$page->id}";
    } else {
        $description = $area->get_excerpt(160);
        $page_title = $area->get_seo_title(" | " . SITE_NAME);
        $bodyclass = "portarea-{$area->id}";
    }
} else {
    $description = $page->get_excerpt(160);
开发者ID:highchair,项目名称:hcd-trunk,代码行数:31,代码来源:header.php


注:本文中的Items::FindByName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。