本文整理汇总了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);
}
示例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>
示例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;