当前位置: 首页>>代码示例>>PHP>>正文


PHP StringUtil::getChoppedStringContent方法代码示例

本文整理汇总了PHP中StringUtil::getChoppedStringContent方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtil::getChoppedStringContent方法的具体用法?PHP StringUtil::getChoppedStringContent怎么用?PHP StringUtil::getChoppedStringContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringUtil的用法示例。


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

示例1: actionEdit

 public function actionEdit($id, $redirectUrl = null)
 {
     $productCategory = ProductCategory::getById(intval($id));
     $breadcrumbLinks = static::getDetailsAndEditBreadcrumbLinks();
     $breadcrumbLinks[] = StringUtil::getChoppedStringContent(strval($productCategory), 25);
     $view = new ProductCategoriesPageView(ProductDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $this->makeEditAndDetailsView($this->attemptToSaveModelFromPost($productCategory, $redirectUrl), 'Edit'), $breadcrumbLinks, 'ProductBreadCrumbView'));
     echo $view->render();
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:8,代码来源:CategoryController.php

示例2: actionEdit

 public function actionEdit($id, $redirectUrl = null)
 {
     $product = Product::getById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserWriteModel($product);
     $breadcrumbLinks = array(StringUtil::getChoppedStringContent(strval($product), 25));
     $view = new ProductsPageView(ProductDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $this->makeEditAndDetailsView($this->attemptToSaveModelFromPost($product, $redirectUrl), 'Edit'), $breadcrumbLinks, 'ProductBreadCrumbView'));
     echo $view->render();
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:8,代码来源:DefaultController.php

示例3: actionEdit

 public function actionEdit($id, $redirectUrl = null)
 {
     $conversation = Conversation::getById(intval($id));
     $conversationsMashableInboxUrl = Yii::app()->createUrl('mashableInbox/default/list', array('modelClassName' => 'Conversation'));
     $breadcrumbLinks = array(Zurmo::t('ConversationsModule', 'Conversations') => $conversationsMashableInboxUrl, StringUtil::getChoppedStringContent(strval($conversation), 25) => array('default/details', 'id' => $id), Zurmo::t('ConversationModule', 'Edit'));
     $conversation = Conversation::getById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserWriteModel($conversation);
     $editView = new ConversationEditView($this->getId(), $this->getModule()->getId(), $this->attemptToSaveModelFromPost($conversation), strval($conversation));
     $view = new ConversationsPageView(ZurmoDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editView, $breadcrumbLinks, 'ConversationBreadCrumbView'));
     echo $view->render();
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:11,代码来源:DefaultController.php

示例4: actionEdit

 public function actionEdit($id, $redirectUrl)
 {
     $autoresponder = Autoresponder::getById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($autoresponder->marketingList);
     $model = $this->attemptToSaveModelFromPost($autoresponder, $redirectUrl);
     $editAndDetailsView = $this->makeEditAndDetailsView($model, 'Edit');
     $breadcrumbLinks = static::getDetailsAndEditBreadcrumbLinks($autoresponder->marketingList);
     $breadcrumbLinks[] = StringUtil::getChoppedStringContent(strval($autoresponder), 25);
     $view = new AutorespondersPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editAndDetailsView, $breadcrumbLinks, 'MarketingBreadCrumbView'));
     echo $view->render();
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:11,代码来源:DefaultController.php

示例5: testGetChoppedStringContentFromString

 public function testGetChoppedStringContentFromString()
 {
     $testString = 'This is a test string to test the getchoppedstringcontent method for stringutil class.';
     $compairSting = 'This is a test string to test the getchoppedstringcontent...';
     $newSting = StringUtil::getChoppedStringContent($testString, 60);
     $this->assertEquals($compairSting, $newSting);
     $testString = 'This is a test string to test the getchoppedstringcontent method for stringutil class.';
     $compairSting = 'This is a test string to test the getchoppedstringcontent method for stringutil class.';
     $newSting = StringUtil::getChoppedStringContent($testString, 100);
     $this->assertEquals($compairSting, $newSting);
     $testString = 'This is a test string to test the getchoppedstringcontent method for stringutil class. This is a test string to test the getchoppedstringcontent method for stringutil class.';
     $compairSting = 'This is a test string to test the getchoppedstringcontent method for stringutil class. This is a test string to test...';
     $newSting = StringUtil::getChoppedStringContent($testString, 119);
     $this->assertEquals($compairSting, $newSting);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:15,代码来源:StringUtilTest.php

示例6: stripTagsAndMultipleByteEncode

 protected static function stripTagsAndMultipleByteEncode($moduleName)
 {
     if ($moduleName == null) {
         return;
     }
     $modelName = strip_tags($moduleName);
     $modelName = mb_convert_encoding(StringUtil::getChoppedStringContent($modelName, 40, ''), 'HTML-ENTITIES', 'UTF-8');
     return $modelName;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:9,代码来源:AuditEventsRecentlyViewedUtil.php

示例7: actionDetails

 public function actionDetails($id)
 {
     $emailTemplate = static::getModelAndCatchNotFoundAndDisplayError('EmailTemplate', intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($emailTemplate);
     AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($emailTemplate), 'EmailTemplatesModule'), $emailTemplate);
     $detailsView = new EmailTemplateDetailsView($this->getId(), $this->getModule()->getId(), $emailTemplate, strval($emailTemplate));
     $viewUtil = static::getViewUtilByType($emailTemplate->type);
     $breadCrumbView = static::getBreadCrumbViewByType($emailTemplate->type);
     $breadCrumbLinks = static::getBreadCrumbLinksByType($emailTemplate->type);
     $breadCrumbLinks[] = StringUtil::getChoppedStringContent(strval($emailTemplate), 25);
     $view = new EmailTemplatesPageView($viewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $detailsView, $breadCrumbLinks, $breadCrumbView));
     echo $view->render();
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:13,代码来源:DefaultController.php

示例8: actionEdit

 public function actionEdit($id)
 {
     $marketingList = MarketingList::getById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserWriteModel($marketingList);
     $breadCrumbLinks = static::getDetailsAndEditBreadcrumbLinks();
     $breadCrumbLinks[] = StringUtil::getChoppedStringContent(strval($marketingList), 25);
     $editView = new MarketingListEditView($this->getId(), $this->getModule()->getId(), $this->attemptToSaveModelFromPost($marketingList), strval($marketingList));
     $view = new MarketingListsPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editView, $breadCrumbLinks, 'MarketingBreadCrumbView'));
     echo $view->render();
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:10,代码来源:DefaultController.php

示例9: renderShortenedListViewContent

 /**
  * @param Notification $notification
  * @return string
  */
 public static function renderShortenedListViewContent(Notification $notification)
 {
     $content = strval($notification);
     if ($content != null) {
         $content = '<h4>' . StringUtil::getChoppedStringContent($content, 68) . '</h4>';
     }
     if ($notification->notificationMessage->id > 0) {
         if ($notification->notificationMessage->htmlContent != null && strlen($notification->notificationMessage->htmlContent) < 136) {
             $content .= '<div>' . Yii::app()->format->raw($notification->notificationMessage->htmlContent) . '</div>';
         } elseif ($notification->notificationMessage->textContent != null) {
             $content .= '<div>' . Yii::app()->format->text(StringUtil::getChoppedStringContent($notification->notificationMessage->textContent, 136)) . '</div>';
         }
     }
     return $content;
 }
开发者ID:spiogit,项目名称:cna-seed-project,代码行数:19,代码来源:NotificationsUtil.php

示例10: processEdit

 protected function processEdit(Campaign $campaign)
 {
     if ($campaign->status != Campaign::STATUS_ACTIVE) {
         Yii::app()->user->setFlash('notification', Zurmo::t('CampaignsModule', 'This campaign has already started, you can only edit its name, rights and permissions.'));
     }
     $breadCrumbLinks = static::getDetailsAndEditBreadcrumbLinks();
     $breadCrumbLinks[] = StringUtil::getChoppedStringContent(strval($campaign), 25);
     //todo: wizard
     $editView = new CampaignEditView($this->getId(), $this->getModule()->getId(), $this->attemptToSaveModelFromPost($campaign), strval($campaign));
     $view = new CampaignsPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editView, $breadCrumbLinks, 'MarketingBreadCrumbView'));
     echo $view->render();
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:12,代码来源:DefaultController.php

示例11: actionDetails

 public function actionDetails($id, $renderJson = false, $includeFilesInJson = false)
 {
     $emailTemplate = static::getModelAndCatchNotFoundAndDisplayError('EmailTemplate', intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($emailTemplate);
     if ($renderJson) {
         header('Content-type: application/json');
         echo $this->resolveEmailTemplateAsJson($emailTemplate, $includeFilesInJson);
         Yii::app()->end(0, false);
     }
     AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($emailTemplate), 'EmailTemplatesModule'), $emailTemplate);
     $detailsView = new EmailTemplateEditAndDetailsView('Details', $this->getId(), $this->getModule()->getId(), $emailTemplate);
     if ($emailTemplate->type == EmailTemplate::TYPE_WORKFLOW) {
         $breadcrumbLinks = static::getDetailsAndEditForWorkflowBreadcrumbLinks();
         $breadcrumbLinks[] = StringUtil::getChoppedStringContent(strval($emailTemplate), 25);
         $view = new EmailTemplatesPageView(WorkflowDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $detailsView, $breadcrumbLinks, 'WorkflowBreadCrumbView'));
     } elseif ($emailTemplate->type == EmailTemplate::TYPE_CONTACT) {
         $breadcrumbLinks = static::getDetailsAndEditForMarketingBreadcrumbLinks();
         $breadcrumbLinks[] = StringUtil::getChoppedStringContent(strval($emailTemplate), 25);
         $view = new EmailTemplatesPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $detailsView, $breadcrumbLinks, 'MarketingBreadCrumbView'));
     } else {
         throw new NotSupportedException();
     }
     echo $view->render();
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:24,代码来源:DefaultController.php

示例12: actionCopy

 /**
  * Copies the project
  * @param int $id
  */
 public function actionCopy($id, $redirectUrl = null)
 {
     $copyToProject = new Project();
     $postVariableName = get_class($copyToProject);
     $project = Project::getById((int) $id);
     if (!isset($_POST[$postVariableName])) {
         ProjectZurmoCopyModelUtil::copy($project, $copyToProject);
         $this->processEdit($copyToProject);
     } else {
         $breadCrumbLinks = array(StringUtil::getChoppedStringContent(strval($project), 25));
         ProjectZurmoCopyModelUtil::processAfterCopy($project, $copyToProject);
         $view = new ProjectsPageView(ProjectDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $this->makeEditAndDetailsView($this->attemptToSaveModelFromPost($copyToProject, $redirectUrl), 'Edit'), $breadCrumbLinks, 'ProjectBreadCrumbView'));
         echo $view->render();
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:19,代码来源:DefaultController.php

示例13: getLinkString

 /**
  * @param string $attributeString
  * @param string $attribute
  * @return string
  */
 public function getLinkString($attributeString, $attribute)
 {
     $string = 'ZurmoHtml::link(';
     $string .= StringUtil::getChoppedStringContent($attributeString, ProductElementUtil::PRODUCT_NAME_LENGTH_IN_PORTLET_VIEW) . ', ';
     $string .= 'Yii::app()->createUrl("' . $this->getGridViewActionRoute('details') . '", array("id" => $data->id))';
     $string .= ')';
     return $string;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:13,代码来源:ProductsRelatedListView.php

示例14: setCalendarItemTitle

 /**
  * Called in CalendarUtil to set the title.
  * @param CalendarItem $calendarItem
  * @param RedBeanModel $model
  */
 public function setCalendarItemTitle(CalendarItem $calendarItem, RedBeanModel $model)
 {
     $calendarItem->setTitle(StringUtil::getChoppedStringContent($model->name, CalendarItem::MAXIMUM_TITLE_LENGTH));
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:9,代码来源:CustomManagement.php

示例15: renderDescriptionContent

 /**
  * Renders description
  * @return string
  */
 protected function renderDescriptionContent()
 {
     $content = ZurmoHtml::tag('div', array('class' => static::DESCRIPTION_CLASS), StringUtil::getChoppedStringContent($this->model->description, 50));
     return $content;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:9,代码来源:ProjectDetailsOverlayView.php


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