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


PHP yii::app方法代码示例

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


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

示例1: run

 public function run()
 {
     if ($sourcetype == '') {
         $sourcetype = 37;
     }
     $connection = yii::app()->db;
     $tracked_userid = Yii::app()->session['login']['id'];
     $Criteria = new CDbCriteria();
     $Criteria->condition = "upload_sourceid = '" . $this->sourceid . "' AND tracked_userid ='" . $tracked_userid . "'and upload_sourcetype='" . $this->sourcetype . "' and view_status=0 and block_status=0";
     $Criteria->order = "note_id DESC";
     $note = Notess::model()->findAll($Criteria);
     foreach ($note as $notes) {
         $ids[] = $notes->tracker_userid;
     }
     $Criteria->join = 'join fn_users as t1	on t1.userid = t.tracker_userid ';
     $Criteria->join .= 'join fn_contentnote as t2 on t2.id = t.contentnote_id ';
     $Criteria->addInCondition('t.tracker_userid', $ids);
     //$Criteria->group = 't.tracker_userid';
     $Criteria->select = "t.*,t1.fname,t2.name";
     $note = Notess::model()->findAll($Criteria);
     $content_note = Contentnote::model()->findAll();
     //echo $content_note->contentnote_id;
     //print_r($content_note);
     /*SELECT t.*,t1.fname FROM `fn_notes` as t
     		join fn_users as t1 
     		on t1.userid  = t.tracker_userid
     		WHERE t.`tracker_userid` in (616,115)
     		group by t.`tracker_userid`*/
     //echo count($note);
     $this->render('_note', array('type' => $this->widgettype, 'i' => $this->i, 'sourceid' => $this->sourceid, 'userid' => $this->userid, 'uname' => $this->uname, 'sourcetype' => $this->sourcetype, 'notek' => $note, 'result' => $content_note));
 }
开发者ID:gopi158,项目名称:Sample,代码行数:31,代码来源:Notestest_261213.php

示例2: actionView

 public function actionView()
 {
     $radioId = Yii::app()->request->getParam("id", 0);
     $radioName = WapRadioModel::model()->findByPk($radioId)->name;
     $albumId = WapRadioModel::model()->getAlbumByRadio($radioId, "c2.id");
     $radioAvatar = RadioModel::model()->getAvatarUrl($radioId, 's1');
     $album = WapAlbumModel::model()->published()->findByPk($albumId);
     if (!$album) {
         $this->forward("/site/error", true);
     }
     $songsOfAlbum = WapSongModel::model()->getSongsOfAlbum($albumId);
     $artists = AlbumArtistModel::model()->getArtistsByAlbum($albumId);
     $phone = yii::app()->user->getState('msisdn');
     $errorCode = 'success';
     $errorDescription = '';
     $registerText = WapAlbumModel::model()->getCustomMetaData('REG_TEXT');
     ///meta tag
     $AlbumDetail = AlbumModel::model()->findByPk($albumId);
     $artistId = !empty($artists) ? $artists[0]->artist_id : $AlbumDetail->artist_id;
     $ArtistInfo = ArtistModel::model()->findByPk($artistId);
     $this->itemName = $AlbumDetail->name;
     $this->artist = $ArtistInfo->name;
     $this->thumb = AlbumModel::model()->getAvatarUrl($albumId, 's1');
     $this->url = URLHelper::buildFriendlyURL("album", $albumId, Common::makeFriendlyUrl($ArtistInfo->name));
     $this->description = strip_tags($AlbumDetail->description);
     //get other radio
     $parent_id = Yii::app()->params['horoscope']['parent_id'];
     $radioListOther = WapRadioModel::model()->getHoroscopes($parent_id);
     $this->render('detail', array('album' => $album, 'songsOfAlbum' => $songsOfAlbum, 'errorCode' => $errorCode, 'errorDescription' => $errorDescription, 'registerText' => $registerText, 'radioListOther' => $radioListOther, 'radioAvatar' => $radioAvatar));
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:30,代码来源:HoroscopesController.php

示例3: beforeSave

 public function beforeSave()
 {
     if ($this->isNewRecord) {
         $this->iduser = yii::app()->user->id;
     }
     return parent::beforeSave();
 }
开发者ID:hipogea,项目名称:experimento,代码行数:7,代码来源:Listamateriales.php

示例4: actionSaveNew

 public function actionSaveNew()
 {
     try {
         $channelName = Yii::app()->request->getParam('channelName');
         $contentType = Yii::app()->request->getParam('contentType');
         $channelType = Yii::app()->request->getParam('channelType');
         $channelIdentify = Yii::app()->request->getParam('channelIdentify');
         $pid = yii::app()->request->getParam('pid');
         $list = TSChannel::model()->findAll('Channel_Identify=:channelIdentify', array(':channelIdentify' => $channelIdentify));
         if (count($list) >= 1) {
             $result = array('flag' => 'ERROR', 'message' => '栏目标识符已经存在!');
             echo json_encode($result, JSON_UNESCAPED_UNICODE);
         } else {
             $model = new TSChannel();
             $model->Channel_Pid = $pid;
             $model->Channel_Is_Title = $contentType;
             $model->Channel_Is_Parent = $channelType == '0' ? 'true' : 'false';
             $model->Channel_Name = $channelName;
             $model->Channel_Is_Open = 'true';
             $model->Channel_Identify = $channelIdentify;
             $flag = $model->save();
             $result = array('flag' => 'SUCCESS', 'message' => '栏目添加成功!', 'newNodes' => array('id' => $model->Id, 'name' => $model->Channel_Name, 'pId' => $model->Channel_Pid, 'isParent' => $model->Channel_Is_Parent, 'open' => $model->Channel_Is_Open));
             echo json_encode($result, JSON_UNESCAPED_UNICODE);
         }
     } catch (Exception $e) {
         $result = array('flag' => 'Exception', 'message' => $e->getMessage());
         echo json_encode($result, JSON_UNESCAPED_UNICODE);
     }
 }
开发者ID:JavaBird,项目名称:Easy3W,代码行数:29,代码来源:ChannelController.php

示例5: hayerrores

 public function hayerrores($codocu)
 {
     if (count($_SESSION[self::NOMBRE_SESION][yii::app()->user->id][$codocu]) > 0) {
         return $_SESSION[self::NOMBRE_SESION][yii::app()->user->id][$codocu];
     }
     return null;
 }
开发者ID:hipogea,项目名称:zega,代码行数:7,代码来源:MensajesCompo.php

示例6: isItSelfContact

 /**
  * validate, if its actual user contacts sor actions:
  *  - editableSaver
  *  - ajaxCreate
  *  - delete
  * @return boolean
  */
 public static function isItSelfContact()
 {
     $ppcn_id = false;
     $action = Yii::app()->controller->action->id;
     switch (Yii::app()->controller->action->id) {
         //update
         case 'editableSaver':
             $ppcn_id = yii::app()->request->getParam('pk');
             //delete
         //delete
         case 'delete':
             if (!$ppcn_id) {
                 $ppcn_id = yii::app()->request->getParam('ppcn_id');
             }
             if (!$ppcn_id) {
                 return false;
             }
             $ppcn = PpcnPersonContact::model()->findByPk($ppcn_id);
             if (!$ppcn || $ppcn->ppcnPprs->pprs_id != Yii::app()->getModule('user')->user()->profile->person_id) {
                 return false;
             }
             break;
             //create
         //create
         case 'ajaxCreate':
             if (yii::app()->request->getParam('value') != Yii::app()->getModule('user')->user()->profile->person_id) {
                 return false;
             }
             break;
         default:
             return false;
             break;
     }
     return true;
 }
开发者ID:dbrisinajumi,项目名称:d2person,代码行数:42,代码来源:PpcnPersonContactController.php

示例7: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate($idobservacion)
 {
     $model = new Observacionesdetalle();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Observacionesdetalle'])) {
         $model->attributes = $_POST['Observacionesdetalle'];
         $model->hidobservaciones = $idobservacion;
         $model->usuario = Yii::app()->user->name;
         $model->fecha = date("d-m-Y H:i:s");
         if ($model->save()) {
             $modeloinventario = Observaciones::model()->findByPk($idobservacion);
         }
         if (!$this->enviamail($modeloinventario, $model->comentario)) {
             echo "fallo";
             yii::app()->end();
         }
         $model->refresh();
         if (!empty($_GET['asDialog'])) {
             //Close the dialog, reset the iframe and update the grid
             echo CHtml::script("window.parent.\$('#cru-dialog1').dialog('close');\n\t\t\t\t\t\t\t\t\t\t\t\t\t                    window.parent.\$('#cru-frame1').attr('src','');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twindow.parent.\$.fn.yiiGridView.update('{$_GET['gridId']}');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
             Yii::app()->end();
         }
         $this->render('Confirma', array('id' => $model->id));
         Yii::app()->end();
         //$this->redirect(array('view','id'=>$model->id));
     }
     $this->layout = '//layouts/iframe';
     $this->render('create', array('model' => $model, 'idobservacion' => $idobservacion));
 }
开发者ID:hipogea,项目名称:zega,代码行数:34,代码来源:ObservacionesdetalleController.php

示例8: saveModel

 public function saveModel()
 {
     if (!$this->save()) {
         yii::app()->user->setFlash('error', CHtml::errorSummary($this));
         return false;
     }
     return true;
 }
开发者ID:jasonhai,项目名称:yii1.1-user-auth-module,代码行数:8,代码来源:ExtAccounts.php

示例9: beforeSave

 public function beforeSave()
 {
     if ($this->isNewRecord) {
         $this->c_estado = '99';
         $this->idusertemp = yii::app()->user->id;
     }
     return parent::beforeSave();
 }
开发者ID:hipogea,项目名称:zega,代码行数:8,代码来源:Tempdetgui.php

示例10: actionIndex

 public function actionIndex()
 {
     $data = $_REQUEST;
     $class = new ExternalServices();
     $class->data = $data;
     $class->{$data}['action']();
     echo $class->output();
     yii::app()->end();
 }
开发者ID:ashishvazirani,项目名称:food,代码行数:9,代码来源:ExternalController.php

示例11: actionDetial

 public function actionDetial()
 {
     $id = yii::app()->request->getParam('id');
     $article = TSArticle::model()->findByPk($id);
     $channel = TSChannel::model()->find('Channel_Identify =:channelIden', array("channelIden" => $article->Channel_Identify));
     $this->breadcrumbs = array($channel->Channel_Name => $this->createUrl('show/solutions'), $article->Article_Title);
     $list = TSArticle::model()->publish()->findAll('Id != :id and Channel_Identify =:ci', array(':id' => $id, ':ci' => $article->Channel_Identify));
     $this->render('solutions_detail', array('article' => $article, 'list' => $list));
 }
开发者ID:JavaBird,项目名称:Easy3W,代码行数:9,代码来源:SolutionsController.php

示例12: actionView

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     $model = $this->loadModel($id);
     if ($model->user_type == 'USER') {
         $this->render('view', array('model' => $model));
     } else {
         $this->redirect(yii::app()->createUrl(''));
     }
 }
开发者ID:indresh90,项目名称:utopeen_webpeoduct,代码行数:13,代码来源:UserController.php

示例13: init

 public function init()
 {
     MyLanguage::setLanguage();
     if (empty(Yii::app()->user->id)) {
         if (!stripos(yii::app()->request->getUrl(), 'login')) {
             $this->redirect(Yii::app()->createUrl('login/login'));
         }
     }
 }
开发者ID:vin120,项目名称:wap,代码行数:9,代码来源:CLoginController.php

示例14: actionCaseDetail

 public function actionCaseDetail()
 {
     $id = yii::app()->request->getParam('id');
     $article = TSArticle::model()->findByPk($id);
     $parentChannel = TSChannel::model()->find('Channel_Identify =:pChannelIden', array(':pChannelIden' => $article->Channel_Parent_Identify));
     $channel = TSChannel::model()->find('Channel_Identify =:channelIden', array("channelIden" => $article->Channel_Identify));
     $this->breadcrumbs = array($parentChannel->Channel_Name => $this->createUrl('show/cases'), $channel->Channel_Name => $this->createUrl('cases/caseForOne', array('id' => $article->Channel_Identify)), $article->Article_Title);
     $this->render('case_detail', array('article' => $article));
 }
开发者ID:JavaBird,项目名称:Easy3W,代码行数:9,代码来源:CasesController.php

示例15: actionNewDashboard

 public function actionNewDashboard()
 {
     $this->layout = '//layouts/dashboard_layout';
     Yii::app()->getClientScript()->registerCssFile(yii::app()->request->baseUrl . '/css/newdashboard.css');
     if (Yii::app()->user->isGuest) {
         Yii::app()->user->loginRequired();
     } else {
         $this->render('newdashboard');
     }
 }
开发者ID:sharmarakesh,项目名称:edusec-college-management-system,代码行数:10,代码来源:SiteController.php


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