Exemplo n.º 1
0
 public function init()
 {
     if (!\Yii::$app->user->isGuest) {
         if (Collection::isFav(['obj_type' => $this->object['obj_type'], 'obj_id' => $this->object['obj_id']])) {
             $this->status = 1;
             $this->label = "已收藏";
         }
     }
     $assets = \Yii::$app->assetManager->publish('@app/modules/favorite/exts/assets/', ['forceCopy' => true]);
     $this->getView()->registerJsFile($assets['1'] . '/favorite.js', ['depends' => [AppAsset::className()]]);
 }
Exemplo n.º 2
0
<?php

/**
 * Created by PhpStorm.
 * User: dev
 * Date: 03.03.15
 * Time: 10:35
 * @var $event \common\models\Event
 * @var $this  \yii\web\View
 */
use common\models\User;
use yii\helpers\Url;
$this->registerJsFile('/js/event-view.js', ['depends' => \frontend\assets\YMapAsset::className()]);
$this->registerCssFile('/css/event-view.css', ['depends' => \frontend\assets\AppAsset::className()]);
$date = \common\helpers\Time::toDateTime($event->begin);
$this->title = $event->name;
?>

<div class="row">
	<div class="col-md-12">
		<div class="row">
			<div class="col-md-6 col-lg-5">
				<div class="panel panel-default">
					<div class="event-buttons">
						<?php 
if ($event->isMy()) {
    ?>
							<a href="<?php 
    echo Url::to(['event/edit', 'id' => $event->id]);
    ?>
" class="event-favorite"><i
Exemplo n.º 3
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\Region;
$this->title = Yii::t('app', 'My') . Yii::t('app', 'Address');
$this->params['breadcrumbs'][] = $this->title;
$this->registerCssFile('@web/css/user.css', ['depends' => \frontend\assets\AppAsset::className()]);
?>
<style>
.form button.btn {
    width: 108px;
    height: 38px;
}
</style>

<div class="my_nala_detail my_address">
    <h1><?php 
echo $this->title;
?>
</h1>
    <div class="detail_r">
        <?php 
$form = ActiveForm::begin(['id' => '']);
?>
        <?php 
echo Html::activeHiddenInput($model, 'user_id', ['value' => Yii::$app->user->id]);
?>
        <div class="form-bd" id="first-addr-form">
            <ul class="form addr-form" id="addr-form">
Exemplo n.º 4
0
                    d. Вернуть фирму, имеющую максимальное кол-во телефонов.
                </div>
                <div class="row">
                    <div class="col-lg-3">
                        <?php 
echo GridView::widget(['dataProvider' => $dataProvider5, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'Name', 'pPhone']]);
?>
                    </div>
                </div>
                <div class="row">

                    SELECT *
                    FROM `Firms`
                    LEFT JOIN `Phones` ON `id` = `FirmID`
                    GROUP BY `id`
                    HAVING count( `phone_id` ) = (SELECT MAX( `cpid` ) AS `mcpid`
                    FROM (
                    SELECT count( `FirmID` ) AS `cpid`
                    FROM `Firms`
                    LEFT JOIN `Phones` ON `id` = `FirmID`
                    GROUP BY `FirmID`
                    ) AS cphone)
                </div>
            </div>
        </div>
    </div>
</div>

<?php 
$this->registerJsFile('/js/tab.js', ['depends' => AppAsset::className()]);
Exemplo n.º 5
0
 public static function addCss($view, $cssfile)
 {
     $view->registerCssFile($cssfile, [AppAsset::className(), 'depends' => 'frontend\\assets\\AppAsset']);
 }
Exemplo n.º 6
0
<?php

/**
 * Created by PhpStorm.
 * User: albert
 * Date: 05.03.15
 * Time: 22:36
 * @var $this   \yii\web\View
 * @var $user   \common\models\User
 * @var $avatar \frontend\models\AvatarForm
 */
\frontend\assets\JCrop::register($this);
$appAssetName = \frontend\assets\AppAsset::className();
$this->registerJsFile('/js/avatar-change.js', ['depends' => [$appAssetName]]);
$this->registerCssFile('/css/avatar-change.css', ['depends' => [$appAssetName]]);
$form = \yii\bootstrap\ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data', 'enableAjaxValidation' => true]]);
echo $form->field($avatar, 'x', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'y', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'x2', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'y2', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'w', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'h', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'oH', ['template' => '{input}'])->hiddenInput();
echo $form->field($avatar, 'oW', ['template' => '{input}'])->hiddenInput();
?>
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div id="avatar-change-container" class="panel-body">
                    <?php 
echo $form->field($avatar, 'img', ['template' => "{input}\n{hint}\n{error}"])->fileInput(['class' => 'hidden', 'accept' => 'image/*']);
Exemplo n.º 7
0
<?php

use yii\helpers\Url;
use yii\helpers\Html;
$this->registerJsFile('/js/custom/download.js', ['depends' => \frontend\assets\AppAsset::className()]);
?>
<div class="container" style="padding: 0px 35px">
    <div class="row pos bg_preview_post">

        <div class="row">
            <div class="col-md-12" style="text-align: center">
                <h3>Книги22</h3>
            </div>
        </div>


        <div class="row">

            <?php 
if ($model) {
    ?>
                <?php 
    foreach ($model as $book) {
        ?>

                    <div class="span3">
                        <?php 
        echo Html::img('/upload/book-thumbs/' . $book->image, ['width' => '50px']);
        ?>
                        <?php 
        echo $book->image;
Exemplo n.º 8
0
<?php

/* @var $this yii\web\View */
$this->title = 'Funshop';
$this->registerCssFile('@web/css/index.css', ['depends' => \frontend\assets\AppAsset::className()]);
$this->registerJsFile('@web/js/switchable.js', ['depends' => \frontend\assets\AppAsset::className()]);
?>


<div class="index-banner">
    <div class="index-slide" id="index-slide">
        <ul>
            <li data-img="/images/banner1.jpg">
                <a href="#" title=""></a>
            </li>
            <li data-img="/images/banner2.jpg">
                <a href="#" title=""></a>
            </li>
            <li data-img="/images/banner3.jpg">
                <a href="#" title=""></a>
            </li>
            <li data-img="/images/banner4.jpg">
                <a href="#" title=""></a>
            </li>
            <li data-img="/images/banner1.jpg">
                <a href="#" title=""></a>
            </li>
            <li data-img="/images/banner2.jpg">
                <a href="#" title=""></a>
            </li>
            <li data-img="/images/banner3.jpg">
Exemplo n.º 9
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use frontend\assets\AppAsset;
$this->registerJsFile('/js/custom/switch-banner.js', ['depends' => AppAsset::className()]);
$this->title = 'Баннеры';
$this->params['breadcrumbs'][] = $this->title;
?>
<div id="content">
    <div class="outer">
        <div class="inner bg-light lter">
            <div id="collapse4" class="body">
                <!--Begin Datatables-->
                <div class="image-index">

                    <h1><?php 
echo Html::encode($this->title);
?>
</h1>


                    <p>
                        <?php 
echo Html::a('Загрузить баннер(ы)', ['/banner/default/upload'], ['class' => 'btn btn-success']);
?>
                    </p>
              

                    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['name', ['attribute' => 'name', 'format' => 'html', 'value' => function ($dataProvider) {
Exemplo n.º 10
0
 public static function addScript($view, $jsfile)
 {
     $view->registerJsFile($jsfile, [AppAsset::className(), 'depends' => 'frontend\\assets\\AppAsset']);
 }
Exemplo n.º 11
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use dosamigos\tinymce\TinyMce;
use yii\helpers\Url;
use frontend\assets\AppAsset;
$this->registerJsFile('/js/custom/tiny.js', ['depends' => AppAsset::className()]);
?>



<?php 
$form = ActiveForm::begin();
?>

<?php 
echo $form->field($model, 'title')->textInput(['maxlength' => 255]);
?>

<?php 
echo $form->field($model, 'image')->textInput(['maxlength' => 255]);
?>

<?php 
if ($model->image && $model->image != '') {
    ?>
    <img src="<?php 
    echo $model->image;
    ?>
" height="200px">