public function ActionPreview($id) { $bucket = Buckets::model()->findByPk($id); if (!$bucket) { Yii::app()->notify->add("Файл не найден в песочнице"); $this->render("/site/index"); return false; } $this->render("preview", array("bucket" => $bucket)); }
</h4> </div> </div> <div class="panel-body "> <p>В настоящий момент отображаются только задания типа html+css</p> <?php if ($student->hasPortfolio) { ?> <?php $portfolio = Buckets::model()->findAllByAttributes(array("student" => $student->id, "portfolio" => true)); ?> <?php foreach ($portfolio as $i => $item) { ?> <p><?php echo $i; ?> . <a href="/sandbox/<?php echo $item->id; ?> /preview"><u><?php echo $item->title; ?>
public function getHasPortfolio() { $solutions_count = Solutions::model()->countByAttributes(array("student" => $this->id, "publish" => true)); $buckets_count = Buckets::model()->countByAttributes(array("student" => $this->id, "portfolio" => true)); return $solutions_count + $buckets_count; }