當前位置: 首頁>>代碼示例>>PHP>>正文


PHP kirbytext函數代碼示例

本文整理匯總了PHP中kirbytext函數的典型用法代碼示例。如果您正苦於以下問題:PHP kirbytext函數的具體用法?PHP kirbytext怎麽用?PHP kirbytext使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了kirbytext函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的kirbytext函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。