本文整理汇总了PHP中CUtil::wordWrap方法的典型用法代码示例。如果您正苦于以下问题:PHP CUtil::wordWrap方法的具体用法?PHP CUtil::wordWrap怎么用?PHP CUtil::wordWrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtil
的用法示例。
在下文中一共展示了CUtil::wordWrap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: populateRecentPurchasesAndReviews
public function populateRecentPurchasesAndReviews($p_id, $u_id)
{
$recent_purchases = array();
$d_arr = MpFeedbackItem::whereRaw('feedback_item_id = ? AND feedback_user_id != ? AND item_type = ?', array($p_id, $u_id, 'product'))->get(array('feedback_comment', 'feedback_status', 'feedback_user_id', DB::raw('DATE_FORMAT(date_added, "%b %d, %Y") AS date_added')));
$inc = 0;
foreach ($d_arr as $data) {
$posted_user_details = CUtil::getUserDetails($data['feedback_user_id']);
$recent_purchases[$inc]['posted_by'] = $posted_user_details['display_name'];
$recent_purchases[$inc]['date_added'] = $data['date_added'] != '' ? $data['date_added'] : '-';
$recent_purchases[$inc]['profile_url'] = $posted_user_details['profile_url'];
$recent_purchases[$inc]['icon'] = CUtil::getUserPersonalImage($data['feedback_user_id']);
$recent_purchases[$inc]['feedback_comment'] = $data['feedback_comment'];
$recent_purchases[$inc]['show_more_notes'] = 0;
$recent_purchases[$inc]['feedback_comment_full'] = CUtil::makeClickableLinks(nl2br($data['feedback_comment']));
if (strlen($data['feedback_comment']) > 250) {
$recent_purchases[$inc]['feedback_comment'] = CUtil::wordWrap($data['feedback_comment'], 250);
$recent_purchases[$inc]['show_more_notes'] = 1;
}
$recent_purchases[$inc]['feedback_status'] = $data['feedback_status'];
$inc++;
}
return $recent_purchases;
}
示例2: sendProductMailToUserAndAdmin
public function sendProductMailToUserAndAdmin($p_id, $user_notes = '')
{
$product_details = Product::where('id', $p_id)->first();
$user_details = CUtil::getUserDetails($product_details->product_user_id);
$product_code = $product_details->product_code;
$url_slug = $product_details->url_slug;
$view_url = $this->getProductViewURL($p_id, $product_details);
$subject = trans('webshoppack::product.product_created_published');
if ($product_details['product_status'] == 'ToActivate') {
$subject = trans('webshoppack::product.product_created_to_activate');
} elseif ($product_details['product_status'] == 'NotApproved') {
$subject = trans('webshoppack::product.product_created_disapprove');
}
$data = array('product_code' => $product_details['product_code'], 'product_name' => $product_details['product_name'], 'url_slug' => $product_details['url_slug'], 'product_description' => CUtil::wordWrap($product_details['product_description'], 300), 'product_user_id' => $product_details['product_user_id'], 'is_free_product' => $product_details['is_free_product'], 'product_status' => $product_details['product_status'], 'product_status_lang' => $this->getProductStatusLang($product_details['product_status']), 'product_tags' => $product_details['product_tags'], 'display_name' => $user_details['display_name'], 'user_email' => $user_details['email'], 'view_url' => $view_url, 'subject' => $subject, 'user_notes' => $user_notes);
//Mail to User
\Mail::send('webshoppack::emails.productCreated', $data, function ($m) use($data) {
$m->to($data['user_email']);
$m->subject($data['subject']);
});
$this->sendNotificationMailForAdmin($p_id, compact('product_details', 'user_details'));
}