本文整理汇总了PHP中ecco函数的典型用法代码示例。如果您正苦于以下问题:PHP ecco函数的具体用法?PHP ecco怎么用?PHP ecco使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ecco函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: projects
/**
*
* This function provides an easier way to display projects. Instead of having
* to repeat the same code over and over on every page that should display the
* projects gallery, with this function you just type in 'projects()' and
* your options.
*
* @author Irvin Dominguez <aguynamedirvin@gmail.com>
* @version 1.0.0
*
*
* Usage:
* ======
* <?php projects() ?>
*
* Example:
* <div class="gallery">
* <?php projects() ?>
* </div>
*
*
*
* Options:
* ========
*
* You can control the limit of the projects to display and other options
* by supplying an associative array.
*
* <?php projects(array('visibleOnly' => true, 'limit' => 4)); ?>
*
*
* Possible options (defaults in parenthesis):
* -------------------------------------------
*
* 'visibleOnly' (true) If true, only shows visible projects.
*
* 'limit' (9) The number of projects to display.
*
* 'columns' (3) The number of columns that will be displayed
*
* 'shuffle' (false) Displays random projects
*
* 'filterBy' (empty) Filters projects by a defined set of options which are 'by', 'tag', and 'separator'
*
*/
function projects($options = array())
{
/**
* Default Options
*/
$defaults = array('limit' => 9, 'columns' => 3, 'shuffle' => FALSE, 'filterBy' => NULL);
/**
* Merge default and given options
*/
$options = array_merge($defaults, $options);
/**
* Get projects from the Projects page
*/
$projects = page('projects')->images();
/*if ($options['visibleOnly']) {
$projects = $projects->visible();
}*/
if ($options['shuffle']) {
$projects = $projects->shuffle();
}
/*if (!array_key_exists('filterBy', $options)) {
$projects = $projects->filterBy(
$options['filterBy']['by'],
$options['filterBy']['tag'],
$options['filterBy']['separator']
);
}*/
$projects = $projects->limit($options['limit']);
/**
* Main Loop
*/
$count = 0;
foreach ($projects as $project) {
$count++;
?>
<div class="project__thumb<?php
ecco($count % $options['columns'] == 0, ' last');
?>
">
<a href="<?php
echo page('projects')->url();
?>
">
<?php
echo $project->crop(400, 280, 75)->html();
?>
<button class="btn btn-line aligncenter"><?php
echo l::get('view_projects_btn');
?>
</button>
</a>
</div>
<?php
}
//.........这里部分代码省略.........
示例2: foreach
<h1>Christian Zehetner</h1>
<?php
// main menu items
$items = $pages->visible();
?>
<?php
if ($items->count() > 0) {
?>
<ul class="site-nav__list">
<?php
foreach ($items as $item) {
?>
<li class="site-nav__item"><a class="site-nav__link <?php
ecco($item->isOpen(), 'site-nav__link--active');
?>
" href="<?php
echo $item->url();
?>
"><?php
echo html($item->title());
?>
</a></li>
<?php
}
?>
</ul>
<?php
}
?>
示例3: ecco
<!DOCTYPE html>
<html lang="<?php
ecco($page->lang() == '', 'de', $page->lang());
?>
" />
<!-- header.php -->
<head>
<title><?php
ecco($page->title() == 'Zuhause', html($site->title()), html($site->title()) . ': ' . html($page->title()));
?>
</title>
<meta charset="utf-8" />
<meta name="description" content="<?php
echo html($site->description());
?>
" />
<meta name="robots" content="index, follow" />
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width">
<!-- DEBUG (disable caching) -->
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<!-- END DEBUG -->
<?php
echo css('assets/css/octavo.css');
?>
<!-- link rel="icon" href="/assets/images/favicon-16.png" sizes="16x16" type="image/png">
<link rel="icon" href="/assets/images/favicon-32.png" sizes="32x32" type="image/png">
<link rel="icon" href="/assets/images/favicon-48.png" sizes="48x48" type="image/png">
示例4: foreach
<?php
if ($page->hasImages()) {
?>
<section class="gallery">
<?php
$first = true;
?>
<?php
foreach ($page->images() as $photo) {
?>
<!-- Radio button (hidden with CSS) -->
<input <?php
ecco($first, 'checked');
?>
type="radio" name="thumbnail" id="<?php
echo $photo->hash();
?>
">
<!-- Large photo -->
<img src="<?php
echo thumb($photo, array('height' => 300))->dataUri();
?>
" title="<?php
echo $photo->title();
?>
"/>
示例5: foreach
?>
<?php
if (count($prices)) {
?>
<ul class="prices small-block-grid-1 medium-block-grid-2">
<?php
foreach ($prices as $price) {
?>
<li>
<div class="small-12 columns">
<strong><?php
echo $price->name();
?>
</strong>
<?php
ecco(trim($price->description()) != '', $price->description()->kirbytext());
?>
</div>
<form class="small-12 columns" method="post" action="<?php
echo url('shop/cart');
?>
">
<input type="hidden" name="action" value="add">
<input type="hidden" name="uri" value="<?php
echo $page->uri();
?>
">
<input type="hidden" name="variant" value="<?php
echo str::slug($price->name());
?>
">
示例6: ecco
echo ecco($facebook->isNotEmpty(), '<li><a href="' . $facebook->toURL() . '"><i class="fa fa-facebook"></i></a></li>');
?>
<!-- Twitter -->
<?php
echo ecco($twitter->isNotEmpty(), '<li><a href="' . $twitter->toURL() . '"><i class="fa fa-twitter"></i></a></li>');
?>
<!-- Instagram -->
<?php
echo ecco($instagram->isNotEmpty(), '<li><a href="' . $instagram->toURL() . '"><i class="fa fa-instagram"></i></a></li>');
?>
<!-- Google Plus -->
<?php
echo ecco($googleplus->isNotEmpty(), '<li><a href="' . $googleplus->toURL() . '"><i class="fa fa-google-plus"></i></a></li>');
?>
</ul>
</div>
</div>
</footer>
<!-- JavaScript -->
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>-->
<?php
echo js('assets/js/vendor/jquery-2.2.0.min.js');
?>
<?php
示例7: ecco
<input type="hidden" name="variant" value="<?php
echo str::slug($variant->name());
?>
">
<h3 dir="auto" class="uk-margin-small-bottom" property="name" content="<?php
echo $page->title() . ' – ' . $variant->name();
?>
"><?php
echo $variant->name();
?>
</h3>
<div property="description">
<?php
ecco(trim($variant->description()) != '', $variant->description()->kirbytext()->bidi());
?>
</div>
<?php
if ($variant->hasOptions) {
?>
<select dir="auto" class="uk-width-1-1" name="option">
<?php
foreach (str::split($variant->options()) as $option) {
?>
<option value="<?php
echo str::slug($option);
?>
"><?php
echo str::ucfirst($option);
示例8: ecco
<section id="content">
<article>
<header>
<hgroup>
<?php
echo $page->title_styled()->markdown();
?>
</hgroup>
<hr>
<section class="subtitle"><?php
echo $page->subtitle()->kirbytext();
?>
</section>
<?php
ecco($page->subtitle(), "<hr>", "");
?>
<aside id="post-meta">
<div class="place"><?php
echo $page->city()->html();
?>
</div>
<div class="author">Printed for <div class="author-name"><?php
echo $page->author()->html();
?>
</div>, in <em><?php
echo $page->borrow()->html();
?>
</em></div>
<hr>
示例9: ecco
?>
<article class="bloglist">
<header>
<hgroup>
<?php
echo $article->title_styled()->markdown();
?>
</hgroup>
<hr>
<section class="subtitle"><?php
echo $article->subtitle()->kirbytext();
?>
</section>
<?php
ecco($article->subtitle(), "<hr>", "");
?>
<aside id="post-meta">
<div class="place"><?php
echo $article->city()->html();
?>
</div>
<div class="author">Printed for <div class="author-name"><?php
echo $article->author()->html();
?>
</div>, in <em><?php
echo $article->borrow()->html();
?>
</em></div>
<hr>
示例10: foreach
<ul class="mobile-nav list-bare" data-ui-component="mobile-nav">
<?php
foreach ($pages->visible() as $p) {
?>
<!--
--><li class="<?php
ecco(mg::showSubpages($p), 'dropdown');
?>
">
<a class="<?php
ecco(mg::showSubpages($p), 'dropdown__toggle');
?>
<?php
echo $p->isOpen() ? ' active ' : '';
?>
" href="<?php
echo $p->url();
?>
">
<?php
echo html($p->title());
?>
<?php
if (mg::showSubpages($p)) {
?>
<span class="dropdown__icon fa fa-caret-down"></span>
<?php
}
?>
</a>
<?php
示例11: foreach
<?php
foreach ($pages->visible() as $item) {
?>
<?php
if ($item->isOpen()) {
$iscurrent = true;
} elseif ($site->activePage() == 'home' && $item->uri() == 'register') {
$iscurrent = true;
} elseif ($site->activePage() == 'erweiterte-suche' && $item->uri() == 'register') {
$iscurrent = true;
} else {
$iscurrent = false;
}
?>
<li<?php
ecco($iscurrent, ' class="active"');
?>
>
<div class="triangle-left"></div>
<a href="<?php
echo $item->url();
?>
">
<h5><?php
echo html($item->title());
?>
</h5>
</a>
<div class="triangle-right"></div>
</li>
<?php
示例12: thumb
?>
<?php
$val = $img->filename();
?>
<option
value="<?php
echo $val;
?>
"
data-img-src="<?php
echo thumb($img, array('width' => $width), false);
?>
"
<?php
ecco($val == $value, ' selected="selected"');
?>
>
<?php
echo $img->name();
?>
</option>
<?php
}
?>
</select>
<?php
} else {
示例13: ecco
if ($slide->text()->isNotEmpty()) {
?>
<p class="summary"><?php
echo $slide->text();
?>
</p>
<?php
}
?>
<?php
if ($slide->button_text()->isNotEmpty() && $slide->button_link()->isNotEmpty()) {
?>
<a class="btn btn-big<?php
ecco($slide->button_style() == 'btn-line', ' btn-line');
ecco($slide->button_style() == 'btn-dark', ' btn-dark');
?>
" role="button" href="<?php
echo $slide->button_link();
?>
">
<?php
echo html($slide->button_text());
?>
</a>
<?php
}
?>
</div>
</div>
</div>
示例14: snippet
<!-- Logo -->
<a href="<?php
echo $site->language->url();
?>
" class="logo" title="<?php
echo $site->title()->html();
?>
"></a>
<!-- Main Navigation Menu -->
<?php
snippet('nav');
?>
</div>
</div>
<main <?php
ecco(!$page->isHomePage(), 'class="pad"');
?>
>
<?php
if (param('status') != 'free-estimate' & !$page->isHomePage()) {
?>
<?php
snippet('free_estimate');
?>
<?php
}
示例15: foreach
<nav>
<ul class="submenu">
<?php
foreach ($items as $item) {
?>
<?php
if ($item->labelnavigation() != '') {
$labelNavigation = $item->labelnavigation();
} else {
$labelNavigation = $item->title();
}
?>
<li><a<?php
ecco($item->isOpen(), ' class="active"');
?>
href="<?php
echo $item->url();
?>
"><?php
echo html($labelNavigation);
?>
</a></li>
<?php
}
?>
<div class="uuu"></div>
</ul>
</nav>
<?php