当前位置: 首页>>代码示例>>PHP>>正文


PHP Place::validate方法代码示例

本文整理汇总了PHP中Place::validate方法的典型用法代码示例。如果您正苦于以下问题:PHP Place::validate方法的具体用法?PHP Place::validate怎么用?PHP Place::validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Place的用法示例。


在下文中一共展示了Place::validate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionAddPlace

 public function actionAddPlace()
 {
     $model = new Place();
     $imageList = $this->_gets->getPost('imageList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     if (isset($_POST['Place'])) {
         $model->attributes = $_POST['Place'];
         $model->host_id = $this->_user['hostId'];
         $model->pic_other = $imageListSerialize['dataSerialize'];
         $file = XUpload::upload($_FILES['attach']);
         $adr = XUpload::upload($_FILES['pic_adr']);
         if (is_array($file)) {
             $model->pic = $file['pathname'];
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         // if ($model->pic == null){
         // Yii::app()->user->setFlash('picMessage','主页图不能为空');
         // }
         if (is_array($adr)) {
             $model->pic_adr = $adr['pathname'];
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         if ($model->pic_adr == null) {
             Yii::app()->user->setFlash('picAdrMessage', '主图不能为空');
         }
         if ($model->validate() && $model->save()) {
             $this->redirect(array('/host/default/myplace'));
         }
     }
     $this->render('addplace', array('model' => $model, 'imageList' => $imageListSerialize['data']));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:33,代码来源:DefaultController.php

示例2: actionAddPlace

 public function actionAddPlace()
 {
     $model = new Place();
     $imageList = $this->_gets->getPost('imageList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     if (isset($_POST['Place'])) {
         $model->attributes = $_POST['Place'];
         $model->host_id = $this->_user['hostId'];
         $model->pic_other = $imageListSerialize['dataSerialize'];
         $file = XUpload::upload($_FILES['attach'], array('thumb' => true, 'thumbSize' => array(192, 470)));
         $adr = XUpload::upload($_FILES['pic_adr'], array('thumb' => true, 'thumbSize' => array(498, 364)));
         if (is_array($file)) {
             $model->pic = $file['paththumbname'];
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         if (is_array($adr)) {
             $model->pic_adr = $adr['paththumbname'];
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         if ($model->validate() && $model->save()) {
             $this->redirect(array('/host/default/myplace'));
         }
     }
     $this->render('addplace', array('model' => $model, 'imageList' => $imageListSerialize['data']));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:27,代码来源:DefaultController.php

示例3: validatePlace

/**
 * Callback function to validate data
 * @return bool must return true or other hooks don't get called
 */
function validatePlace($editPage, $textBox1, $section, &$hookError)
{
    $ns = $editPage->mTitle->getNamespace();
    if ($ns == NS_PLACE) {
        $place = new Place($editPage->mTitle->getText());
        $place->validate($textBox1, $section, $hookError, true);
    }
    return true;
}
开发者ID:k-hasan-19,项目名称:wiki,代码行数:13,代码来源:Place.php


注:本文中的Place::validate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。