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


PHP CStringHelper::trim方法代碼示例

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


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

示例1: display

 /**
  * The default method that will display the output of this view which is called by
  * Joomla
  *
  * @param   string template Template file name
  **/
 public function display($tpl = null)
 {
     // Trigger load default library.
     CAssets::getInstance();
     if ($this->getLayout() == 'edit') {
         $this->_displayEditLayout($tpl);
         return;
     }
     $document = JFactory::getDocument();
     // Set the titlebar text
     JToolBarHelper::title(JText::_('COM_COMMUNITY_GROUPS'), 'groups');
     // Add the necessary buttons
     JToolBarHelper::addNew('newGroup', JText::_('COM_COMMUNITY_PROFILES_NEW_GROUP'));
     JToolBarHelper::deleteList(JText::_('COM_COMMUNITY_GROUP_DELETION_WARNING'), 'deleteGroup', JText::_('COM_COMMUNITY_DELETE'));
     JToolBarHelper::divider();
     JToolBarHelper::publishList('publish', JText::_('COM_COMMUNITY_PUBLISH'));
     JToolBarHelper::unpublishList('unpublish', JText::_('COM_COMMUNITY_UNPUBLISH'));
     // Get required data's
     $groups = $this->get('Groups');
     $categories = $this->get('Categories');
     $pagination = $this->get('Pagination');
     // We need to assign the users object to the groups listing to get the users name.
     for ($i = 0; $i < count($groups); $i++) {
         $row =& $groups[$i];
         $row->user = CFactory::getUser($row->ownerid);
         $row->description = strip_tags($row->description, '<strong><a>');
         $row->description = CStringHelper::trim($row->description, 200);
         $row->category = $this->_getCatName($categories, $row->categoryid);
     }
     $mainframe = JFactory::getApplication();
     $filter_order = $mainframe->getUserStateFromRequest("com_community.groups.filter_order", 'filter_order', 'a.name', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest("com_community.groups.filter_order_Dir", 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest("com_community.users.search", 'search', '', 'string');
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     $catHTML = $this->_getCategoriesHTML($categories);
     $this->assignRef('groups', $groups);
     $this->assignRef('categories', $catHTML);
     $this->assignRef('lists', $lists);
     $this->assignRef('search', $search);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:50,代碼來源:view.html.php

示例2:

        echo $row->title;
        ?>
</a>
                        </td>
                        <td>
                            <a href="javascript:void(0);" onClick="azcommunity.editVideo('<?php 
        echo $row->id;
        ?>
');"><?php 
        echo JText::_('Edit');
        ?>
</a>
                        </td>
                        <td align="center">
                            <?php 
        echo CStringHelper::trim($row->description, 200);
        ?>
                        </td>
                        <td id="published<?php 
        echo $row->id;
        ?>
" align="center" class='center'>
                            <?php 
        echo $this->getPublish($row, 'published', 'videos,ajaxTogglePublish');
        ?>
                        </td>
                        <td>
                            <?php 
        echo $row->categoryName;
        ?>
                        </td>
開發者ID:Jougito,項目名稱:DynWeb,代碼行數:31,代碼來源:default.php

示例3: foreach

?>

<?php 
if ($videos) {
    ?>
<ul class="video-items indexList cResetList">
<?php 
    foreach ($videos as $video) {
        ?>

<li id="<?php 
        echo "video-" . $video->id;
        ?>
">
<div class="video-item jomTips tipFullWidth" title="<?php 
        echo $video->title . '::' . CStringHelper::trim($this->escape($video->description), VIDEO_TIPS_LENGTH);
        ?>
">
		<!---VIDEO THUMB-->
    <div class="video-thumb">
        <?php 
        if ($video->status == 'pending') {
            ?>
            <img src="<?php 
            echo JURI::root();
            ?>
/components/com_community/assets/video_thumb.png" width="<?php 
            echo $videoThumbWidth;
            ?>
" height="<?php 
            echo $videoThumbHeight;
開發者ID:bizanto,項目名稱:Hooked,代碼行數:31,代碼來源:videos.list.php


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