Skip to content

Instantly share code, notes, and snippets.

View mdmunir's full-sized avatar

Misbahul D Munir mdmunir

View GitHub Profile
<h1>Welcome to CodeIgniter!</h1>
<div id="body">
<table width="100%">
<tbody>
<?php foreach($users as $user): ?>
<tr>
<th><?= $user->id?></th>
<td><?= $user->username?></td>
<td><?= $user->email?></td>
<?php
namespace app\controllers;
use Yii;
use mdm\upload\FileModel;
use yii\web\NotFoundHttpException;
use yii\imagine\Image;
use yii\helpers\FileHelper;
@mdmunir
mdmunir / Helper.php
Created August 10, 2016 09:44
Serializer for API Rest
<?php
namespace classes\data;
use yii\base\Model;
/**
* Description of Helper
*
* @author Misbahul D Munir <[email protected]>
<?php
namespace app\classes;
use Yii;
use yii\db\BaseActiveRecord;
use yii\db\Query;
use yii\db\ActiveQuery;
use yii\helpers\Inflector;
use yii\helpers\StringHelper;
@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
*/
<?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;
<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\controllers;
use Yii;
use app\models\ContactInfo;
use yii\web\Controller;
use yii\filters\VerbFilter;
/**
<?php
namespace app\models;
/**
* Description of ContactInfo
*
* @author Misbahul D Munir <[email protected]>
* @since 1.0
*/
<?php
use yii\db\Migration;
class m160414_015201_contact_info extends Migration
{
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {