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


PHP Gdn_Format::markdown方法代碼示例

本文整理匯總了PHP中Gdn_Format::markdown方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gdn_Format::markdown方法的具體用法?PHP Gdn_Format::markdown怎麽用?PHP Gdn_Format::markdown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gdn_Format的用法示例。


在下文中一共展示了Gdn_Format::markdown方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: parseReadme

 /**
  * Parse an addon's README file.
  *
  * @param string $Path The base path to search from.
  * @return string
  */
 protected function parseReadme($Path)
 {
     $ReadmePaths = array('/readme', '/README', '/readme.md', '/README.md', '/readme.txt', '/README.txt');
     $Description = '';
     // Get the list of potential files to analyze.
     $Entries = UpdateModel::findFiles($Path, $ReadmePaths);
     if ($Entries === false) {
         return '';
     }
     foreach ($Entries as $Entry) {
         $ReadMeContents = file_get_contents($Entry['Path']);
         $Description = Gdn_Format::markdown($ReadMeContents);
     }
     $FolderPath = substr($Path, 0, -4);
     Gdn_FileSystem::removeFolder($FolderPath);
     return $Description;
 }
開發者ID:vanilla,項目名稱:community,代碼行數:23,代碼來源:class.addoncontroller.php

示例2: t

<?php

if (!defined('APPLICATION')) {
    exit;
}
?>
<div class="SplashInfo">
    <div class="Center">
        <h1><?php 
echo $this->data('Title', t('Whoops!'));
?>
</h1>

        <div id="Message">
            <?php 
echo Gdn_Format::markdown($this->sanitize($this->data('Exception', 'No error message supplied.')));
?>
        </div>
    </div>
    <?php 
if (debug() && $this->data('Trace')) {
    ?>
        <h2>Error</h2>
        <?php 
    echo $this->data('Code') . ' ' . htmlspecialchars(Gdn_Controller::getStatusMessage($this->data('Code')));
    ?>
        <h2>Trace</h2>
        <pre stye="text-align"><?php 
    echo htmlspecialchars($this->data('Trace'));
    ?>
</pre>
開發者ID:caidongyun,項目名稱:vanilla,代碼行數:31,代碼來源:error.php

示例3: t

     $typeHelp = t('AddonHelpFor' . $addonType, '');
     if ($typeHelp) {
         echo '<div class="Help">' . $typeHelp . '</div>';
     }
 }
 if ($this->data('Icon') != '') {
     echo '<img class="Icon" src="' . Gdn_Upload::url($this->data('Icon')) . '" itemprop="image" />';
 }
 $currentVersion = $this->data('CurrentVersion');
 if ($currentVersion && $currentVersion != $this->data('Version')) {
     echo '<p>', sprintf(t("This is not the most recent version of this plugin.", 'This is not the most recent version of this plugin. For the most recent version click <a href="%s">here</a>.'), URL('addon/' . AddonModel::Slug($this->Data, false))), '</p>';
 }
 echo '<div itemprop="description">';
 echo Gdn_Format::html($this->data('Description'));
 if ($this->data('Description2') && $ver != 'v1') {
     echo '<br /><br />', Gdn_Format::markdown($this->data('Description2'));
 }
 echo '</div>';
 ?>
 </div>
 <?php 
 if ($this->PictureData->numRows() > 0) {
     ?>
     <div class="PictureBox">
         <?php 
     foreach ($this->PictureData->result() as $picture) {
         echo '<span class="AddonPicture">';
         echo '<a rel="popable[gallery]" href="#Pic_' . $picture->AddonPictureID . '"><img src="' . Gdn_Upload::url(ChangeBasename($picture->File, 'at%s')) . '" itemprop="screenshot" /></a>';
         if ($session->UserID == $this->data('InsertUserID') || checkPermission('Addons.Addon.Manage')) {
             echo '<a class="Popup DeletePicture" href="' . Url('/addon/deletepicture/' . $picture->AddonPictureID) . '">x</a>';
         }
開發者ID:vanilla,項目名稱:community,代碼行數:31,代碼來源:addon.php


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