Ejemplo n.º 1
0
use common\components\Vista;
use common\components\ImagenHelper;
use common\extensions\cmsAB\dropzone\DropZone;
/* @var $this yii\web\View */
/* @var $model common\models\forms\CrearEditarArticuloForm */
/* @var $articulo common\models\Articulos */
/* @var $listadocategorias common\models\Articulos */
/* @var $form yii\widgets\ActiveForm */
//$this->registerJsFile('@web/js/core/demo/PublicarArticulosForm.js', ['depends' => [BackendAsset::className()]]);
//$this->registerJsFile('@web/js/core/demo/DemoFormEditors.js', ['depends' => [BackendAsset::className()]]);
//$this->registerJsFile('@web/js/core/demo/DemoFormComponents.js', ['depends' => [BackendAsset::className()]]);
//$this->registerJsFile('@web/js/core/demo/DemoUIMessages.js', ['depends' => [BackendAsset::className()]]);
//$this->registerJsFile('@web/js/libs/crop/cropper.js', ['depends' => [BackendAsset::className()]]);
//$this->registerJsFile('@web/js/libs/crop/main.js', ['depends' => [BackendAsset::className()]]);
UsuarioAsset::register($this);
$baseUrl = UsuarioAsset::register($this)->baseUrl;
$inputOpciones = ['template' => "{input}\n{label}\n{hint}\n{error}\n", 'options' => ['class' => 'form-group floating-label']];
$inputDineroOpciones = ['template' => "{label}\n{input}<i class=\"zmdi zmdi-money form-control-feedback l-h-34\"></i>\n{hint}\n{error}\n", 'options' => ['class' => 'form-group has-feedback']];
$inputReadOpciones = ['template' => "{label}\n{input}\n{hint}\n{error}\n", 'options' => ['class' => 'form-group floating-label']];
$inputRadioListOpciones = ['style' => 'margin-top: 10px;', 'tag' => 'div', 'item' => function ($index, $label, $name, $checked, $value) {
    $seleccion = $checked == true ? 'checked' : '';
    $html = '<div class="radio radio-primary radio-inline">
                    <input id="' . $index . '_' . $name . '" type="radio" name="' . $name . '" value="' . $value . '" ' . $seleccion . '>
                    <label for="' . $index . '_' . $name . '">' . $label . '</label>
                 </div>';
    return $html;
}, 'itemOptions' => ['labelOptions' => []]];
$inputCheckBoxListOpciones = ['style' => 'margin-top: 10px;', 'tag' => 'div', 'class' => 'control-group', 'item' => function ($index, $label, $name, $checked, $value) {
    $seleccion = $checked == true ? 'checked' : '';
    $html = '<div class="checkbox checkbox-primary checkbox-inline">
                    <input id="' . $index . '_' . $name . '" type="checkbox" name="' . $name . '" value="' . $value . '" ' . $seleccion . '>
Ejemplo n.º 2
0
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
use kartik\file\FileInput;
use yii\web\View;
use yii\web\JsExpression;
use frontend\assets\UsuarioAsset;
use common\components\Vista;
use common\components\ImagenHelper;
use common\extensions\cmsAB\dropzone\DropZone;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $model common\models\Mensajes */
/* @var $articulo common\models\Mensajes */
/* @var $usuario common\models\Mensajes */
/* @var $form yii\widgets\ActiveForm */
UsuarioAsset::register($this);
$this->registerJs('$("document").ready(function(){
        $("#mensaje-usuario").on("pjax:end", function() {
             //$("#mensaje").trigger("reset");
            $.pjax.reload({container:"#conversacion-usuarios"});  //Reload ListView
            //window.cmsAB.Animaciones._publicarArticulo("mostrar");
            $("form[id=mensaje]").find("textarea").each( function(){
                  $(this).val("");
             });
        });
    });');
?>


<?php 
Pjax::begin(['id' => 'mensaje-usuario']);