本文整理匯總了PHP中ArticleModel::getNWordsFromText方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArticleModel::getNWordsFromText方法的具體用法?PHP ArticleModel::getNWordsFromText怎麽用?PHP ArticleModel::getNWordsFromText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ArticleModel
的用法示例。
在下文中一共展示了ArticleModel::getNWordsFromText方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: viewArticlePage
function viewArticlePage($user_id)
{
$htmlPage = "";
$user_id = (int) $user_id;
$articleModel = new ArticleModel();
$aLastArticles = $articleModel->getLastArticles(10);
$htmlPage = '<ul class="content-preview-list articles-preview-list">';
foreach ($aLastArticles as $article) {
/* $htmlPage .= '
<div class="articles_t">
<h1><a href="'.Project::getRequest()->createUrl('Article', 'ArticleView').'/'.$article['id'].'">'.$article['title'].'</a></h1> <div id="micro"><img height="16" width="16" id="ico2" src="'.$this->image_url.'time.png"/> '.$article['creation_date'].'</div>
</div>
<div class="articles_c">
<br/><p>'.$articleModel -> getNWordsFromText($article['page_text'], 100).'</p>
</div>'; */
$htmlPage .= '<li class="expanded-view">
<h3><a href="' . Project::getRequest()->createUrl('Article', 'ArticleView') . '/' . $article['id'] . '">' . $article['title'] . ' <img src="' . $this->image_url . 'time.png" alt="' . $article['title'] . '" /></a></h3>
<p>' . $articleModel->getNWordsFromText($article['page_text'], 100) . ' <a href="' . Project::getRequest()->createUrl('Article', 'ArticleView') . '/' . $article['id'] . '">»</a></p>
<div class="meta">
<span class="auth">Вести.Ru</span>
<span class="date">' . $article['creation_date'] . ' минут назад</span>
</div>
</li>';
}
$htmlPage .= '</ul>';
return $htmlPage;
}