本文整理汇总了PHP中XUtils::titleStyle方法的典型用法代码示例。如果您正苦于以下问题:PHP XUtils::titleStyle方法的具体用法?PHP XUtils::titleStyle怎么用?PHP XUtils::titleStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XUtils
的用法示例。
在下文中一共展示了XUtils::titleStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionUpdate
/**
* 更新
*
* @param $id
*/
public function actionUpdate($id)
{
parent::_acl();
$attr = $this->_gets->getParam('attr');
$model = parent::_dataLoad(new Post(), $id);
$imageList = $this->_gets->getParam('imageList');
$imageListSerialize = XUtils::imageListSerialize($imageList);
if (isset($_POST['Post'])) {
$style = $this->_gets->getParam('style');
$acl = $this->_gets->getParam('acl');
$styleFormat = XUtils::titleStyle($style);
$model->attributes = $_POST['Post'];
$file = XUpload::upload($_FILES['attach'], array('thumb' => true, 'thumbSize' => array(400, 250)));
if (is_array($file)) {
$model->attach_file = $file['pathname'];
$model->attach_thumb = $file['paththumbname'];
$model->attach_status = 'Y';
@unlink($_POST['oAttach']);
@unlink($_POST['oThumb']);
}
$model->title_style = $styleFormat['text'];
$model->title_style_serialize = $styleFormat['serialize'];
$model->acl = is_array($acl) ? implode(',', $acl) : '';
$model->image_list = $imageListSerialize['dataSerialize'];
if ($model->save()) {
Attr::xupdate($model->id, $attr);
Post2tags::build('update', $_POST['Post']['tags'], $model->id, $model->catalog_id);
AdminLogger::_create(array('catalog' => 'update', 'intro' => '编辑内容,ID:' . $id));
$this->redirect(array('index'));
}
}
$attrModel = Attr::lists($model->catalog_id, 'post');
if ($attr) {
$attrData = Attr::dataReset($attr);
} else {
$attrData = Attr::datas($model->id);
}
if ($imageList) {
$imageList = $imageListSerialize['data'];
} elseif ($model->image_list) {
$imageList = unserialize($model->image_list);
}
$this->render('update', array('model' => $model, 'imageList' => $imageList, 'attrModel' => $attrModel, 'attrData' => $attrData, 'groupList' => $this->_groupList('user')));
}