• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP kirbytext函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中kirbytext函数的典型用法代码示例。如果您正苦于以下问题:PHP kirbytext函数的具体用法?PHP kirbytext怎么用?PHP kirbytext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: charcountnospaces

function charcountnospaces($content)
{
    $words = kirbytext($content);
    $words = strip_tags($words);
    $words = trim($words);
    $words = ereg_replace('[[:space:]]+', '', $words);
    $charcount = strlen($words);
    return $charcount;
}
开发者ID:nilshendriks,项目名称:textcounter,代码行数:9,代码来源:textcounter.php


示例2: readingtime

function readingtime($content, $params = array())
{
    $defaults = array('minute' => 'minute', 'minutes' => 'minutes', 'second' => 'second', 'seconds' => 'seconds', 'format' => '{minutesCount} {minutesLabel}, {secondsCount} {secondsLabel}');
    $options = array_merge($defaults, $params);
    //$words   = str_word_count(strip_tags($content));
    $words = kirbytext($content);
    $words = str_word_count(strip_tags($words));
    $minutesCount = floor($words / 200);
    $secondsCount = floor($words % 200 / (200 / 60));
    $minutesLabel = $minutesCount == 1 ? $options['minute'] : $options['minutes'];
    $secondsLabel = $secondsCount == 1 ? $options['second'] : $options['seconds'];
    $replace = array('minutesCount' => $minutesCount, 'minutesLabel' => $minutesLabel, 'secondsCount' => $secondsCount, 'secondsLabel' => $secondsLabel);
    $result = $options['format'];
    foreach ($replace as $key => $value) {
        $result = str_replace('{' . $key . '}', $value, $result);
    }
    return $result;
}
开发者ID:nilshendriks,项目名称:kirbycms-extensions,代码行数:18,代码来源:readingtime.php


示例3: convert

 public static function convert($text)
 {
     $n = 1;
     $notes = array();
     if (preg_match_all(self::$patternFootnote, $text, $matches)) {
         foreach ($matches[0] as $fn) {
             $notes[$n] = preg_replace(self::$patternContent, '\\1', $fn);
             if (substr($notes[$n], 1, 4) == '<no>') {
                 $substitute = '';
             } else {
                 $substitute = '<sup class="footnote">';
                 $substitute .= '<a href="#fn-' . $n . '" id="fnref-' . $n . '">' . $n . '</a>';
                 $substitute .= '</sup>';
             }
             $text = str_replace($fn, $substitute, $text);
             $notes[$n] = kirbytext($notes[$n]);
             $notes[$n] = str_replace('<p>', '', $notes[$n]);
             $notes[$n] = str_replace('</p>', '', $notes[$n]);
             $n++;
         }
         // build footnotes references
         $text .= "<div class='footnotes' id='footnotes'>";
         $text .= "<div class='footnotedivider'></div>";
         $text .= "<ol>";
         for ($i = 1; $i < $n; $i++) {
             $text .= "<li id='fn-" . $i . "'>";
             if (substr($notes[$i], 0, 4) == '<no>') {
                 $notes[$i] = str_replace('<no>', "", $notes[$i]);
                 $text .= $notes[$i] . "</li>";
             } else {
                 $text .= $notes[$i] . " <span class='footnotereverse'><a href='#fnref-" . $i . "'>&#8617;</a></span></li>";
             }
         }
         $text .= "</ol>";
         $text .= "</div>";
         if (c::get('footnotes.smoothscroll', false)) {
             $text .= self::script();
         }
         return $text;
     }
     return $text;
 }
开发者ID:laurelschwulst,项目名称:spring2016.veryinteractive.net,代码行数:42,代码来源:footnotes.php


示例4: blockFigure

 public static function blockFigure($content, $caption = false, $caption_top = false, $caption_class = false)
 {
     if ($caption === false) {
         return $content;
     }
     if (is_string($caption)) {
         $caption = kirbytext($caption);
         $figcaption = \Html::tag("figcaption", $caption);
     } else {
         $figcaption = "";
     }
     if ($caption_top !== false) {
         $content = $figcaption . $content;
     } else {
         $content = $content . $figcaption;
     }
     $attr = array();
     if ($caption_class !== false && !empty($caption_class)) {
         $attr['class'] = $caption_class . ($caption_top !== false ? " figcaption-top" : " figcaption-bottom");
     } else {
         $attr['class'] = $caption_top !== false ? "figcaption-top" : "figcaption-bottom";
     }
     return \Html::tag("figure", $content, $attr);
 }
开发者ID:muten84,项目名称:luigibifulco.it,代码行数:24,代码来源:kirbycms-extension-webhelper-lib.php


示例5: kirbytext

    ?>
"><?php 
    echo kirbytext($article->text());
    ?>
</a></td>		
			    <td><a href="<?php 
    echo $article->url();
    ?>
"><?php 
    echo kirbytext($article->type());
    ?>
</a></td>
			    <td class="margin-row"><a href="<?php 
    echo $article->url();
    ?>
"><?php 
    echo kirbytext($article->year());
    ?>
</a></td>
		  </tr>
		  
		  <?php 
}
?>
		
		</table>
	
  	</main>

<?php 
snippet('footer');
开发者ID:robinandersen,项目名称:robin,代码行数:31,代码来源:home.php


示例6: snippet

<?php

snippet('header');
snippet('menu');
?>

<section id="main">
	<div class="container">
		<div class="seven columns intro">
			<?php 
echo kirbytext($page->intro());
?>
		</div>
		<div class="five columns currently">
			<?php 
echo kirbytext($page->currently());
?>
		</div>
	</div>
</section>

<?php 
snippet('footer');
开发者ID:peterbinks,项目名称:peterbinks.net,代码行数:23,代码来源:home.php


示例7: clean

 private function clean($fn)
 {
     $fn = preg_replace($this->regexContent, '\\1', $fn);
     return str_replace(array('<p>', '</p>'), '', kirbytext($fn));
 }
开发者ID:sarahendren,项目名称:engineeringathome,代码行数:5,代码来源:footnotes.php


示例8: kirbytext

<div class="row large-space-top">
  <footer class="small-12 small-centered medium-12 columns">
    <?php 
echo kirbytext($site->copyright());
?>
  </footer>
</div>

<?php 
echo js('assets/js/vendor/jquery.js');
echo js('assets/js/foundation/foundation.min.js');
echo js('assets/js/foundation/foundation.interchange.js');
echo js('assets/js/foundation/foundation.topbar.js');
echo js('assets/js/vendor/kudos.js');
?>

<script>
    $(function() {

        $(document).foundation();

        var kudos = $.ajax({url: "?kudos",async: false});
        var parts = window.location.pathname.split('/');
        uid = parts[parts.length-1] + parts[parts.length-2];

        $(".num").html(kudos.responseText);
        $("figure.kudoable").kudoable();

        if(localStorage.getItem(uid) == 'true') {
            $("figure.kudoable").addClass("complete");
        }
开发者ID:hemorej,项目名称:kirby-foundation,代码行数:31,代码来源:footer.php


示例9: foreach

  <ul class="docs-index-list list-4">
    <?php 
    foreach ($page->children()->visible() as $item) {
        ?>
<!--
 --><li>
      <div class="text">
        <h2 class="delta docs-icon"><a href="<?php 
        echo $item->url();
        ?>
"><?php 
        echo html($item->title());
        ?>
</a></h2>
        <?php 
        echo kirbytext($item->description());
        ?>
      </div>
      <a class="btn" href="<?php 
        echo $item->url();
        ?>
">Learn more</a>
    </li><!--
 --><?php 
    }
    ?>
  </ul>
  <?php 
}
?>
开发者ID:AhoyLemon,项目名称:getkirby.com,代码行数:30,代码来源:docs.index.php


示例10: kirbytextRaw

function kirbytextRaw($content)
{
    $text = kirbytext($content);
    return preg_replace('/(.*)<\\/p>/', '$1', preg_replace('/<p>(.*)/', '$1', $text));
}
开发者ID:rafegoldberg,项目名称:zazu,代码行数:5,代码来源:kt.raw.php


示例11: foreach

    ?>

    <div class="cheatsheet-grid">
      <?php 
    foreach ($child->children() as $doc) {
        ?>
      <div class="cheatsheet-grid-item">
        <a href="<?php 
        echo $doc->url();
        ?>
">
          <h3 class="gamma"><?php 
        echo html($doc->title());
        ?>
</h3>
          <?php 
        echo kirbytext($doc->excerpt());
        ?>
        </a>
      </div>
      <?php 
    }
    ?>
    </div>

  </section>
  <?php 
}
?>

</main>
开发者ID:AhoyLemon,项目名称:getkirby.com,代码行数:31,代码来源:cheatsheet.php


示例12: function

 * Converts html entities and specialchars in the field
 * value to valid xml entities
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['xml'] = field::$methods['x'] = function ($field) {
    $field->value = xml($field->value);
    return $field;
};
/**
 * Parses the field value as kirbytext
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['kirbytext'] = field::$methods['kt'] = function ($field) {
    $field->value = kirbytext($field);
    return $field;
};
/**
 * Parses the field value as markdown
 * @param Field $field The calling Kirby Field instance
 * @return Field
 */
field::$methods['markdown'] = field::$methods['md'] = function ($field) {
    $field->value = markdown($field->value);
    return $field;
};
/**
 * Converts the field value to lower case
 * @param Field $field The calling Kirby Field instance
 * @return Field
开发者ID:kristianhalte,项目名称:super_organic,代码行数:31,代码来源:methods.php


示例13: foreach

<h2><?php 
echo $pages->about->title();
?>
</h2>
<div class="content">
    <?php 
foreach ($pages->about->images()->limit(1) as $key => $image) {
    ?>
      <div class="bio-image" style="background-image:url(<?php 
    echo $image->url();
    ?>
);">
      </div>
    <?php 
}
?>

  <div class="bio-text">
    <?php 
echo kirbytext($pages->about->about());
?>
  </div>
</div>
开发者ID:hegyessy,项目名称:latmospheresf.com,代码行数:23,代码来源:about.php


示例14: snippet

<?php

snippet('header');
?>

<main class="main grid" role="main">

  <h1 class="alpha"><?php 
echo html($page->title());
?>
</h1>

  <section class="col-3-6 text">
    <h2 class="beta">Responsibility</h2>
    <?php 
echo kirbytext($page->contact());
?>
  </section>

  <section class="col-3-6 last text">
    <h2 class="beta">Disclaimer</h2>
    <?php 
echo kirbytext($page->disclaimer());
?>
  </section>

</main>

<?php 
snippet('footer');
开发者ID:AhoyLemon,项目名称:getkirby.com,代码行数:30,代码来源:contact.php


示例15: kirbytext

  <footer class="site-footer" role="contentinfo">
    <?php 
echo kirbytext($site->info());
?>
  </footer>

</body>
</html>
开发者ID:quiqueciria,项目名称:eurovelo,代码行数:8,代码来源:footer.php


示例16: url

">Documentation</a></li>
      <?php 
if ($page->tutorial() != '') {
    ?>
      <li><a href="<?php 
    echo url();
    echo $page->tutorial();
    ?>
">Tutorial</a></li>
      <?php 
}
?>
    </ul>
    <div class="text smaller">
      <?php 
echo kirbytext($page->description());
?>
    </div>
    <?php 
if ($page->author() != '') {
    ?>
    <small>Made by <a href="<?php 
    echo $page->author_url();
    ?>
"><?php 
    echo $page->author();
    ?>
</a><?php 
    if ($page->twitter() != '') {
        ?>
 | <a href="http://twitter.com/<?php 
开发者ID:AhoyLemon,项目名称:getkirby.com,代码行数:31,代码来源:download.php


示例17: kirbytext

<?php

// use template name as twig template filename
$template = $page->template() . '.' . c::get('twig.file.extension');
// pass data to twig template
echo $twig->render($template, ['site' => $site, 'page' => ['title' => $page->title(), 'template' => $page->template(), 'text' => kirbytext($page->text())]]);
开发者ID:evendev,项目名称:grg,代码行数:6,代码来源:default.php


示例18: array

            $imagethumb = html::img('', array('data-src' => 'http://' . c::get('resrc.plan') . '/' . c::get('resrc.params') . '/' . $thumburl, 'class' => $class . ' resrc', 'alt' => html($alt)));
        }
        // [4] Lazyload + resrc image; full size thumb (let resrc resize and optimize the biggest possible thumb!)
        if ($lazyload == true && c::get('resrc') == true) {
            $imagethumb = html::img('/assets/images/loader.gif', array('data-src' => 'http://' . c::get('resrc.plan') . '/' . c::get('resrc.params') . '/' . $thumburl, 'class' => $class . ' js-resrcIsLazy', 'alt' => html($alt)));
        }
        // Output different markup, depending on lazyload or not
        if ($lazyload == true) {
            $lazydiv->append($imagethumb);
            if (isset($griddiv)) {
                $griddiv->append($lazydiv);
                $figure->append($griddiv);
            } else {
                $figure->append($lazydiv);
            }
        } else {
            $figure->append($imagethumb);
        }
        $i++;
    }
    // Add caption
    if (!empty($caption)) {
        // Also add break class to figcaption if alignment is set to image
        if (count($widths) > 0 && isset($align)) {
            $figure->append('<figcaption class="FigureImage-caption u-size' . $width . '--' . $break . '">' . kirbytext($caption) . '</figcaption>');
        } else {
            $figure->append('<figcaption class="FigureImage-caption">' . kirbytext($caption) . '</figcaption>');
        }
    }
    return $figure;
});
开发者ID:igorqr,项目名称:kirby-extensions,代码行数:31,代码来源:figure.php


示例19: kirbytext

			</video>
		<?php 
    }
    ?>
	</section>
	<?php 
}
?>

	<section class="about">
		<h2 class="site-description"><?php 
echo $site->description();
?>
</h2>
		<?php 
echo kirbytext($pages->find('/about-us')->text());
?>
	</section>

	<section class="main">
		<nav class="main-nav">
			<div class="ctrl shutter" title="Open Thumb Menu"></div>
			<div class="ctrl left" title="Previous Image"><img src="/assets/images/arrow_rightleft.png" alt"left arrow"/></div>
			<div class="ctrl right" title="Next Image"><img src="/assets/images/arrow_rightleft.png" alt"right arrow"/></div>
			<div class="ctrl up" title="Previous Project"><!--<img src="/assets/images/arrow_updown.png" alt"up arrow"/>--></div>
			<div class="ctrl down" title="Next Project"><!--<img src="/assets/images/arrow_updown.png" alt"down arrow"/>--></div>
		</nav>
		<div class="main-frame">
		</div>
	</section>
开发者ID:codecuts,项目名称:lanningsmith-website,代码行数:30,代码来源:body.php


示例20: function

<?php

/**
 * Table Plugin
 * based on Bastian Allgeier <[email protected]> Columns plugin.
 *
 * @author Julien Gargot <[email protected]>
 * @version 1.0.0
 */
kirbytext::$pre[] = function ($kirbytext, $text) {
    $text = preg_replace_callback('!\\(table(…|\\.{3})\\)(.*?)\\((…|\\.{3})table\\)!is', function ($matches) use($kirbytext) {
        $rows = preg_split('!(\\n|\\r\\n)\\+{4}\\s+(\\n|\\r\\n)!', $matches[2]);
        $html = array();
        foreach ($rows as $row) {
            $field = new Field($kirbytext->field->page, null, trim($row));
            $columns = preg_split('!(\\n|\\r\\n)\\/{4}\\s+(\\n|\\r\\n)!', $field);
            $htmlColumns = array();
            foreach ($columns as $column) {
                $field = new Field($kirbytext->field->page, null, trim($column));
                $htmlColumns[] = '<td>' . kirbytext($field) . '</td>';
            }
            $html[] = '<tr>' . implode($htmlColumns) . '</tr>';
        }
        return '<table class="' . c::get('table.container', 'table') . '">' . implode($html) . '</table>';
    }, $text);
    return $text;
};
开发者ID:scsskid,项目名称:kirby-plugin-table,代码行数:27,代码来源:table.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP kirki_get_option函数代码示例发布时间:2022-05-15
下一篇:
PHP kirby函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap