Skip to content

Instantly share code, notes, and snippets.

View jamband's full-sized avatar
👀
web browser

Tomoki Morita jamband

👀
web browser
View GitHub Profile
<?php
...
Yii::createWebApplication($config)->run();
echo Yii::getLogger()->getExecutionTime(); // 追加
@jamband
jamband / User.php
Last active September 28, 2015 10:38
<?php
class User extends CActiveRecord
{
public $password2;
...
public function rules()
{
return array(
...
array('password', 'compare', 'compareAttribute'=>'password2', 'message'=>'{attribute} とパスワード(確認)が一致しません。', 'on'=>'register'),
<?php
class UserIdentity extends CUserIdentity
{
private $id;
public function authenticate()
{
$model = User::model()->findByAttributes(array(
'username' => $this->username,
));
@jamband
jamband / main.php
Last active September 28, 2015 10:38
<?php
...
'import' => array(
...
'ext.PasswordHash',
),
...
'params' => array(
'iteration_count_log2' => 12,
'portable_hashes' => false,
@jamband
jamband / main.php
Last active September 28, 2015 10:38
<?php
return array(
...
'components' => array(
'cache' => array(
'class' => 'CFileCache',
),
...
'db' => array(
...
@jamband
jamband / contact.php
Last active September 28, 2015 10:38
<?php $this->pageTitle = Yii::app()->name . ' - Contact Us'; ?>
<?php $this->breadcrumbs = array('Contact'); ?>
<div class="page-header">
<h3>
お問い合わせ
<small>以下のフォームにご記入の上、送信してください</small>
</h3>
</div><!-- /.page-header -->
@jamband
jamband / login.php
Last active September 28, 2015 10:38
<?php $this->pageTitle = Yii::app()->name . ' - Login'; ?>
<?php $this->breadcrumbs = array('Login'); ?>
<div class="page-header">
<h3>
Login
<small>登録済みの方は、こちらからログインしてください</small>
</h3>
</div><!-- /.page-header -->
@jamband
jamband / main.php
Last active September 28, 2015 10:38
<head>
...
<?php echo Yii::app()->bootstrap->registerBootstrap(); ?>
</head>
@jamband
jamband / main.php
Last active September 28, 2015 10:38
<?php
return array(
...
'import' => array(
...
'ext.bootstrap.components.*', // 追加
),
...
'components' => array(
'bootstrap' => array('class' => 'ext.bootstrap.components.Bootstrap'), // 追加
<?php
return array(
...
'components' => array(
...
'db' => array(
...
'enableProfiling' => true,
'enableParamLogging' => true,
),