Example #1
0
 /**
  * @return array|bool|null|\yii\db\ActiveRecord
  */
 public function actionGetpostdata()
 {
     if (Yii::$app->request->isAjax) {
         Yii::$app->response->format = Response::FORMAT_JSON;
         $id = intval(Yii::$app->request->post('id'));
         $participant = Participant::find()->select(['date', 'name', 'text'])->where(['id' => $id])->one();
         if ($participant) {
             $participant->date = Date::DateMonth($participant->date);
             return $participant;
         }
     }
     return false;
 }
Example #2
0
File: main.php Project: ninetor/23
?>
				</div>
				<div id="tab2" class="tab_content">
					<?php 
if (isset($this->params['winners']) && count($this->params['winners']) > 0) {
    ?>
						<?php 
    foreach ($this->params['winners'] as $winner) {
        ?>
							<div class="member-item">
								<div class="member-item__name">
									<?php 
        echo $winner->name;
        ?>
									<span class="member-item__date"><?php 
        echo Date::DateMonth($winner->date);
        ?>
</span>
								</div>
								<div class="member-item__info">
									<?php 
        echo $winner->text;
        ?>
								</div>
							</div>
						<?php 
    }
    ?>
					<?php 
} else {
    ?>