本文整理汇总了PHP中HTMLPurifier::process方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLPurifier::process方法的具体用法?PHP HTMLPurifier::process怎么用?PHP HTMLPurifier::process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLPurifier
的用法示例。
在下文中一共展示了HTMLPurifier::process方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rules
/**
* @inheritdoc
*/
public function rules()
{
return [[['name', 'stateId', 'cityStdCode'], 'required'], [['stateId', 'status', 'isFg', 'priority', 'parentCityId', 'createdBy', 'updatedBy'], 'integer'], [['createdOn', 'updatedOn'], 'safe'], [['name'], 'string', 'max' => 255], [['alias'], 'string', 'max' => 100], [['ip'], 'string', 'max' => 15], [['name'], 'unique', 'targetAttribute' => ['name', 'stateId']], ['name', 'filter', 'filter' => 'trim'], ['name', 'unique'], ['name', 'string', 'min' => 3, 'max' => 60], ['cityStdCode', 'string', 'min' => 2, 'max' => 6], ['cityStdCode', 'common\\validators\\NumberIntegerValidator'], ['name', 'common\\validators\\StringValidator'], ['name', 'filter', 'filter' => function ($value) {
// here we are using HTML purifier helper
return HTMLPurifier::process($value);
}]];
}
示例2: rules
/**
* @inheritdoc
*/
public function rules()
{
return [[['name'], 'required'], [['createdOn'], 'safe'], [['status'], 'integer'], [['name'], 'string', 'max' => 100], ['name', 'filter', 'filter' => function ($value) {
// here we are using HTML purifier helper
return HTMLPurifier::process($value);
}], [['name'], 'common\\validators\\StringValidator'], [['name'], 'unique']];
}
示例3: rules
/**
* @inheritdoc
*/
public function rules()
{
return [[['name'], 'required'], [['Id', 'status', 'createdBy', 'updatedBy'], 'integer'], [['desc'], 'string'], [['createdOn', 'updatedOn'], 'safe'], [['name'], 'string', 'max' => 100], [['ip'], 'string', 'max' => 15], [['alias', 'searchAlias'], 'string', 'max' => 255], [['name', 'desc'], 'filter', 'filter' => function ($value) {
// here we are using HTML purifier helper
return HTMLPurifier::process($value);
}], [['name'], 'common\\validators\\CuisineValidator'], [['name'], 'unique']];
}
示例4: rules
/**
* @inheritdoc
*/
public function rules()
{
return [[['name', 'cityId', 'address', 'zoneId', 'localityId'], 'required'], [['cityId', 'state', 'status', 'createdBy', 'updatedBy', 'noofscreens'], 'integer'], [['gpsLat'], 'number', 'max' => 91], [['gpsLong'], 'number', 'max' => 181], [['createdOn', 'updatedOn', 'hotelId'], 'safe'], [['address', 'guid'], 'string', 'min' => 6, 'max' => 128], [['tollfree', 'bookingNumber'], 'string', 'max' => 12], [['name'], 'string', 'min' => 3, 'max' => 128], [['email', 'website', 'facebookUrl'], 'string', 'min' => 6, 'max' => 100], [['pincode'], 'number', 'min' => 100000, 'max' => 999999], [['landmark'], 'string', 'max' => 150], [['ip'], 'string', 'max' => 15], ['email', 'email'], [['name'], 'filter', 'filter' => 'trim'], ['name', 'common\\validators\\EntitynameValidator'], ['email', 'email'], ['website', 'url'], ['facebookUrl', 'url'], ['gpsLat', 'common\\validators\\GpsValidator'], ['gpsLong', 'common\\validators\\GpsValidator'], ['tollfree', 'common\\validators\\NumberValidator'], ['bookingNumber', 'common\\validators\\NumberValidator'], [['name', 'landmark'], 'filter', 'filter' => function ($value) {
// here we are using HTML purifier
return HTMLPurifier::process($value);
}], ['reason', 'required', 'on' => ['unpublish', 'delete']], ['reasondesc', 'required', 'on' => ['unpublish', 'delete', 'statusupdate']], ['reasondesc', 'string', 'on' => ['unpublish', 'delete', 'statusupdate']], ['redirecturl', 'url', 'on' => ['unpublish', 'delete']], ['status', 'required', 'on' => ['statusupdate']]];
}
示例5: rules
/**
* @inheritdoc
*/
public function rules()
{
return [[['type', 'cityId', 'localityId', 'createdBy', 'updatedBy', 'status'], 'integer'], [['cityId'], 'required'], [['createdOn', 'updatedOn', 'parent_city_id'], 'safe'], [['name'], 'string', 'max' => 100], [['name'], 'unique', 'targetAttribute' => ['name', 'cityId']], [['name'], 'common\\validators\\CuisineValidator'], ['name', 'filter', 'filter' => function ($value) {
// here we are using HTML purifier helper
return HTMLPurifier::process($value);
}]];
}
示例6: rules
/**
* @inheritdoc
*/
public function rules()
{
return [[['cityId', 'zoneId', 'name'], 'required', 'message' => '{attribute} can not be empty.'], [['cityId', 'status', 'isFg', 'pin', 'createdBy', 'updatedBy'], 'integer'], [['createdOn', 'updatedOn'], 'safe'], [['gpsLat', 'gpsLong'], 'string', 'min' => 3, 'max' => 15], [['nearBy'], 'string', 'max' => 500], [['ip'], 'string', 'max' => 15], [['name', 'alias'], 'filter', 'filter' => 'trim'], [['name'], 'unique', 'targetAttribute' => ['name', 'cityId', 'zoneId']], [['name', 'alias'], 'string', 'min' => 3, 'max' => 60], ['name', 'common\\validators\\AlphanumericValidator'], ['alias', 'common\\validators\\AliasnameValidator'], ['gpsLat', 'common\\validators\\GpsValidator'], ['gpsLong', 'common\\validators\\GpsValidator'], ['name', 'filter', 'filter' => function ($value) {
// here we are using HTML purifier helper
return HTMLPurifier::process($value);
}]];
}
示例7: rules
/**
* @inheritdoc
*/
public function rules()
{
return [[['name', 'launguageId'], 'required'], [['synopsis', 'review'], 'string'], [['status', 'state', 'length', 'toiMovieId', 'launguageId'], 'integer'], [['releaseDate', 'createdOn', 'updatedOn', 'cast', 'synopsis', 'review', 'status', 'guid', 'starRating'], 'safe'], [['parentalGuidance'], 'string', 'max' => 5], [['alias', 'tagline', 'movieDirector', 'musicDirector'], 'string', 'max' => 100], [['guid'], 'string', 'max' => 512], [['length'], 'number', 'max' => 240], [['toiMovieId'], 'number'], [['name'], 'common\\validators\\EntitynameValidator'], [['canonicalUrl'], 'url'], ['movieDirector', 'common\\validators\\StringWithCommaSeparatedValidator'], ['musicDirector', 'common\\validators\\StringWithCommaSeparatedValidator'], ['cast', 'common\\validators\\StringWithCommaSeparatedValidator'], ['name', 'filter', 'filter' => function ($value) {
// here we are using HTML purifier
return HTMLPurifier::process($value);
}], ['reason', 'required', 'on' => ['unpublish', 'delete']], ['reasondesc', 'required', 'on' => ['unpublish', 'delete', 'statusupdate']], ['reasondesc', 'string', 'on' => ['unpublish', 'delete', 'statusupdate']], ['redirecturl', 'url', 'on' => ['unpublish', 'delete']], ['status', 'required', 'on' => ['statusupdate']]];
}
示例8: purify
/**
* 富文本过滤
* @param $attribute
* @param array $params
*/
public function purify($attribute, $params = array())
{
//不做进一步判断params的合法性
if (isset($params['Attr.AllowedFrameTargets'])) {
$params['Attr.AllowedFrameTargets'] = array('_blank');
}
$this->{$attribute} = HTMLPurifier::process($this->{$attribute}, $params);
}
示例9: rules
/**
* @inheritdoc
*/
public function rules()
{
return [[['name', 'cityId', 'sourceId', 'description', 'type', 'startDate', 'category'], 'required', 'message' => '{attribute} can not be empty.'], [['pincode'], 'required', 'message' => 'Venue type can not be empty.'], [['price'], 'number', 'max' => 200000], [['tollfree'], 'number'], ['url', 'url'], ['shopurl', 'url'], ['description', 'string'], ['description', 'filter', 'filter' => function ($value) {
// here we are using HTML purifier
return HTMLPurifier::process($value);
}], [['startDate', 'endDate', 'startTime', 'endTime', 'createdOn', 'updatedOn', 'multipleTimings', 'ip', 'type', 'tag', 'isRecursive', 'status', 'price', 'multitag'], 'safe'], [['pincode', 'contactName', 'email', 'url', 'shopurl'], 'string', 'max' => 100], [['name'], 'common\\validators\\EntitynameValidator'], [['name'], 'string', 'min' => 2, 'max' => 100], [['oldGuid', 'guid'], 'string', 'max' => 512], ['email', 'email'], ['name', 'filter', 'filter' => function ($value) {
// here we are using HTML purifier
return HTMLPurifier::process($value);
}]];
}
示例10: purify
public function purify($attribute, $allow = [])
{
$config = HTMLPurifier_Config::createDefault();
$config->set('AutoFormat.AutoParagraph', true);
//$config->set('HTML.AllowedElements', '');
//$config->set('HTML.AllowedElements', explode(',', 'b,br,p,i,u'));
$purifier = new HTMLPurifier($config);
$this->{$attribute} = $purifier->process($this->{$attribute}, $config);
return true;
}
示例11:
<?php
}
?>
<?php
}
?>
<?php
if ($visitModel->remarks) {
?>
<tr>
<td><?php
echo $visitModel->getAttributeLabel('remarks');
?>
</td>
<td><?php
echo HTMLPurifier::process($visit->remarks);
?>
</td>
</tr>
<?php
}
?>
</table>
<h2>
<?php
echo Yii::t('app', 'Waarnemingen');
?>
<?php
if (Yii::$app->user->can('createObservation', ['visit' => $visit])) {
?>
示例12: rules
/**
* @inheritdoc
*/
public function rules()
{
return [[['state', 'sourceId', 'cityId', 'zoneId', 'pin', 'entityType', 'priceForTwo', 'capacity', 'hotelId', 'status', 'healthStatus', 'createdBy', 'updatedBy'], 'integer'], ['localityId', 'integer', 'message' => 'Please select {attribute}'], [['description'], 'string'], [['gpsLat', 'gpsLong', 'coverFee', 'entryFee', 'ladiesFee', 'popularityScore', 'popularityScroreParams'], 'number'], [['createdOn', 'updatedOn', 'launchdate', 'popularpubs', 'state', 'verificationStatus', 'remarks', 'tag', 'chainId'], 'safe'], [['name', 'address', 'landmark', 'alias', 'website', 'facebook', 'tips', 'famousFor', 'specialities'], 'string', 'max' => 255], [['owner', 'manager', 'email'], 'string', 'max' => 100], [['guid', 'old_guid'], 'string', 'max' => 512], [['name', 'entityType', 'cityId', 'localityId', 'address', 'landmark', 'priceForTwo', 'gpsLat', 'gpsLong', 'cuisines'], 'required'], [['name', 'description'], 'filter', 'filter' => function ($value) {
// here we are using HTML purifier
return HTMLPurifier::process($value);
}], [['name'], 'common\\validators\\EntitynameValidator'], [['landmark'], 'common\\validators\\EntitynameValidator'], [['address', 'landmark', 'manager'], 'string', 'min' => 6, 'max' => 128], [['name'], 'string', 'min' => 2, 'max' => 100], [['gpsLat'], 'number', 'max' => 91], [['gpsLong'], 'number', 'max' => 181], ['gpsLat', 'common\\validators\\GpsValidator'], ['gpsLong', 'common\\validators\\GpsValidator'], ['website', 'url'], ['facebook', 'url'], [['capacity'], 'number', 'max' => 999], [['pin'], 'number', 'max' => 999999, 'min' => 100000], ['reason', 'required', 'on' => ['unpublish', 'delete']], ['reasondesc', 'required', 'on' => ['unpublish', 'delete', 'statusupdate']], ['reasondesc', 'string', 'on' => ['unpublish', 'delete', 'statusupdate']], ['redirecturl', 'url', 'on' => ['unpublish', 'delete']], ['status', 'required', 'on' => ['statusupdate']]];
}
示例13: nl2br
<?php
}
?>
</table>
</div>
</div>
<?php
if ($project->remarks) {
?>
<h1><?php
echo Yii::t('app', 'Samenvatting');
?>
</h1>
<?php
echo nl2br(HTMLPurifier::process($project->remarks));
?>
<?php
}
?>
<h1><?php
echo Yii::t('app', 'Kasten');
?>
</h1>
<?php
if (Yii::$app->user->can('boxRights', ['project' => $project])) {
?>
<?php
echo Html::a(Yii::t('app', 'Kast toevoegen'), Url::toRoute(['boxes/form', 'project_id' => $project->id]), ['class' => 'btn btn-info']);
?>
示例14:
<?php
/* @var $this yii\web\View */
/* @var $dp app\modules\page\models\Page */
use yii\helpers\HtmlPurifier;
$this->title = $dp->title;
$this->registerMetaTag(['name' => 'keywords', 'content' => $dp->keywords]);
$this->registerMetaTag(['name' => 'description', 'content' => $dp->description]);
if ($this->beginCache('page', ['duration' => 60, 'variations' => ['id' => $dp->id]])) {
echo HTMLPurifier::process($dp->text, ['Attr.AllowedFrameTargets' => ['_blank', '_self', '_parent', '_top']]);
$this->endCache();
}
示例15: implode
*/
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Events', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="event-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
$dataArray = $model->getAttributes();
$dataArray['phone'] = implode(', ', $model->getPhone());
$dataArray['mobile'] = implode(', ', $model->getMobile());
$dataArray['cityname'] = common\models\City::findOne($model->cityId)->name;
$dataArray['createdBy'] = common\models\User::findOne($model->createdBy)->firstname;
$dataArray['updatedBy'] = common\models\User::findOne($model->updatedBy)->firstname;
$dataArray['sourcename'] = $model->sourcename;
$dataArray['description'] = strip_tags(HTMLPurifier::process($model->description));
$dataArray['guid'] = 'http://timescity.com' . $model->guid;
?>
<?php
echo DetailView::widget(['model' => $dataArray, 'attributes' => ['name', ['attribute' => 'cityname', 'label' => 'City'], ['attribute' => 'sourcename', 'label' => 'Source'], ['attribute' => 'startDate', 'label' => 'Start Date', 'format' => 'date'], ['attribute' => 'endDate', 'label' => 'End Date', 'format' => 'date'], ['attribute' => 'startTime', 'label' => 'Start Time'], ['attribute' => 'endTime', 'label' => 'End Time'], 'description:ntext', 'phone', 'mobile', 'contactName', 'email:email', ['attribute' => 'url', 'label' => 'Event URL/Website', 'format' => 'url'], ['attribute' => 'shopurl', 'label' => 'FB URL', 'format' => 'url'], 'price', 'guid:url', 'createdOn', 'createdBy', 'updatedOn', 'updatedBy']]);
?>
<?php
echo WorkflowButtonsView::widget(['view' => $this, 'model' => $model]);
?>
</div>