本文整理汇总了PHP中ContentHelper::prepareStr方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentHelper::prepareStr方法的具体用法?PHP ContentHelper::prepareStr怎么用?PHP ContentHelper::prepareStr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentHelper
的用法示例。
在下文中一共展示了ContentHelper::prepareStr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preparePartnerSlides
protected function preparePartnerSlides()
{
$slides = array();
$data = Yii::app()->db->createCommand(sprintf('SELECT p.title, ph.filename, ph.title photo_title, ph.description photo_description
FROM partners p
LEFT JOIN gallery g ON g.`gallery_id` = p.gallery_id
LEFT JOIN photo ph ON ph.gallery_id = g.gallery_id
WHERE p.is_active = 1 AND p.partner_id <> %d AND (ph.is_top <> 1 OR ph.is_top IS NULL)
ORDER BY ph.sort_order DESC', Yii::app()->params['partner_id']))->queryAll();
foreach ($data as $slide) {
$slides[] = array('url' => ImageHelper::imageUrl('', $slide['filename']), 'content' => sprintf('<img src=\'%s\' alt\'%s\' title=\'%s\'></img>', ImageHelper::imageUrl('partner_footer_frontend', $slide['filename']), ContentHelper::prepareStr($slide['title']), ContentHelper::prepareStr($slide['title'])));
}
return $slides;
}
示例2: prepareSlides
protected function prepareSlides()
{
$slides = array();
$data = Yii::app()->db->createCommand('SELECT gp.*, p.title post_title, ph.filename, ph.title photo_title, ph.description photo_description, u.firstname, u.lastname
FROM galleryposts gp
LEFT JOIN users u ON u.user_id = gp.user_id
LEFT JOIN posting p ON p.post_id = gp.post_id
LEFT JOIN gallery g ON g.`gallery_id` = p.gallery_id
LEFT JOIN photo ph ON ph.gallery_id = g.gallery_id
WHERE gp.is_top = 1 AND gp.publication_date <= NOW()
ORDER BY ph.sort_order DESC')->queryAll();
foreach ($data as $slide) {
$slides[] = array('url' => ImageHelper::imageUrl('main_page_slider', $slide['filename']), 'content' => sprintf('<a href=\'%s\'><img src=\'%s\' alt=\'%s\' title=\'%s\'></img></a>', Yii::app()->createAbsoluteUrl('portfolio/default/view', array('id' => $slide['post_id'])), ImageHelper::imageUrl('main_page_slider', $slide['filename']), ContentHelper::prepareStr($slide['photo_description']), ContentHelper::prepareStr($slide['photo_description'])));
}
return $slides;
}
示例3:
$date = Yii::app()->dateFormatter->formatDateTime(CDateTimeParser::parse($arr[0], 'yyyy-MM-dd'), 'long', null);
?>
<div class="content-block">
<div class="title">Интересно</div>
<a href="<?php
echo Yii::app()->createAbsoluteUrl('blogs/view/id/' . $data['post_id']);
?>
">
<img src="<?php
echo ImageHelper::imageUrl('blogs_isTop_frontend', $data['photo']['filename']);
?>
" alt="<?php
echo ContentHelper::prepareStr($data['photo']['description']);
?>
" title="<?php
echo ContentHelper::prepareStr($data['photo']['description']);
?>
"/>
</a>
<div>
<h2><a href="<?php
echo Yii::app()->createAbsoluteUrl('blogs/view/id/' . $data['post_id']);
?>
"><?php
echo $data['p_title'];
?>
</a></h2>
<?php
echo $data['anounce'];
?>
<span class="small"><?php
示例4:
<!doctype html>
<!--[if lte IE 8]><html class="lteie8"><![endif]-->
<!--[if gt IE 8]><!--><html><!--<![endif]-->
<head>
<meta charset="utf-8">
<title><?php
echo ContentHelper::prepareStr(Yii::app()->getController()->getTitle());
?>
</title>
<meta name="Description" content="<?php
echo ContentHelper::prepareStr(Yii::app()->getController()->getDescription());
?>
" />
<meta name="KeyWords" content="<?php
echo ContentHelper::prepareStr(Yii::app()->getController()->getKeywords());
?>
" />
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" media="screen" href="<?php
echo Yii::app()->createAbsoluteUrl('/');
?>
/css/style.css" >
<!--[if lt IE 9]><script src="/js/html5.js"></script><![endif]-->
<?php
Yii::app()->clientScript->registerCoreScript('jquery');
//Yii::app()->clientScript->registerScriptFile(Yii::app()->createAbsoluteUrl('/js/jquery-1.9.1.min.js'));
//Yii::app()->clientScript->registerScriptFile(Yii::app()->createAbsoluteUrl('/js/home.js'));
Yii::app()->clientScript->registerScriptFile(Yii::app()->createAbsoluteUrl('/js/swfobject.js'));
//Yii::app()->clientScript->registerScriptFile(Yii::app()->createAbsoluteUrl('/js/slides.min.jquery.js'));
?>
<script type="text/javascript">