Skip to content

Instantly share code, notes, and snippets.

Avatar

Cálcio calcio

View GitHub Profile
View vitrine\modules\admin\controllers\UserController.php
<?php
namespace app\modules\admin\controllers;
use Yii;
use app\modules\admin\models\User;
use app\modules\admin\models\UserSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
View vitrine\modules\admin\models\User.php
<?php
namespace app\modules\admin\models;
use Yii;
use \yii\db\ActiveRecord;
use \yii\web\IdentityInterface;
use \yii\base\NotSupportedException;
use \yii\behaviors\TimestampBehavior;
@calcio
calcio / vitrine\modules\admin\views\user\_form.php
Last active May 22, 2019
Formulário de cadastro de usuário
View vitrine\modules\admin\views\user\_form.php
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\models\User */
/* @var $form yii\widgets\ActiveForm */
?>
View vitrine\components\formatters\BrazilianFormatter.php
<?php
namespace app\components\formatters;
use yii\i18n\Formatter;
class BrazilianFormatter extends Formatter
{
public static function asStatus($value)
{
View docker-compose.yml
version: "3.0"
services:
laravel-web:
container_name: laravel-web
build:
context: ./
dockerfile: docker/web.docker
volumes:
- ./:/var/www
View vitrine\modules\admin\views\product\view.php
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\models\Product */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Products'), 'url' => ['index']];
@calcio
calcio / vitrine\modules\admin\models\ProductSearch.php
Created May 27, 2018
ProductSearch formantando a pesquisa por preço
View vitrine\modules\admin\models\ProductSearch.php
<?php
namespace app\modules\admin\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\modules\admin\models\Product;
/**
@calcio
calcio / vitrine\modules\admin\views\product\index.php
Created May 27, 2018
Index Product customizada e fazendo uso das Relations do Yii2
View vitrine\modules\admin\views\product\index.php
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $searchModel app\modules\admin\models\ProductSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Products');
@calcio
calcio / vitrine\modules\admin\models\Product.php
Created May 27, 2018
Alteração do model Product com validação customizada no atributo price
View vitrine\modules\admin\models\Product.php
<?php
namespace app\modules\admin\models;
use Yii;
use yii\behaviors\TimestampBehavior;
/**
* This is the model class for table "{{%products}}".
*
@calcio
calcio / vitrine\modules\admin\views\product\_form.php
Created May 27, 2018
Alteração do formulário de criação e alteração de Produtos
View vitrine\modules\admin\views\product\_form.php
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $model app\modules\admin\models\Product */
/* @var $form yii\widgets\ActiveForm */
?>
You can’t perform that action at this time.