Skip to content

Instantly share code, notes, and snippets.

View mdmunir's full-sized avatar

Misbahul D Munir mdmunir

View GitHub Profile
{
"name": "demo/my-yii2-app",
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "~2.0"
},
"config": {
"process-timeout": 1800
},
<?php
return [
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'basePath' => dirname(__DIR__),
'components' => [
'cache' => [
'class' => 'yii\caching\FileCache',
],
],
];
<?php
namespace app\controllers;
use Yii;
use yii\web\Controller;
/**
* Site controller
*/
{{ register_asset_bundle('app/assets/AppAsset') }}
{{ void(this.beginPage()) }}
<!DOCTYPE html>
<html lang="{{ app.language }}">
<head>
<meta charset="{{ app.charset }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ html.encode(this.title) }}</title>
{{ html.csrfMetaTags | raw }}
{{ void(this.head()) }}
<?php
use yii\db\Migration;
class m160414_015201_contact_info extends Migration
{
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
<?php
namespace app\models;
/**
* Description of ContactInfo
*
* @author Misbahul D Munir <[email protected]>
* @since 1.0
*/
<?php
namespace app\controllers;
use Yii;
use app\models\ContactInfo;
use yii\web\Controller;
use yii\filters\VerbFilter;
/**
<div class="row">
{{ html.beginForm() | raw}}
{{ html.errorSummary(model) | raw}}
<div class="col-lg-6">
<div class="form-group">
{{ html.activeLabel(model, 'name', {'class': 'control-label'}) | raw}}
{{ html.activeTextInput(model, 'name', {'class': 'form-control'}) | raw}}
</div>
<div class="form-group">
{{ html.activeLabel(model, 'email', {'class': 'control-label'}) | raw}}
<?php
namespace app\classes;
use Yii;
use yii\base\Behavior;
use yii\web\User;
use yii\web\UserEvent;
use yii\di\Instance;
use yii\caching\Cache;
@mdmunir
mdmunir / Db.php
Created July 29, 2016 03:22
Facade Emulator
<?php
namespace app\classes;
/**
* Description of Db
*
* @author Misbahul D Munir <[email protected]>
* @since 1.0
*/