本文整理汇总了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 />";
}
}
示例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);