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
public function actions()
{
return array(
'update' => array(
'class' => 'application.components.actions.UpdateAction',
'redirect' => 'index', // この行を追加
),
);
...
<?php
class HogeController extends Controller
{
/**
* 単純な単一フィールド更新の例
*/
public function actionIsChecked($id)
{
Hoge::model()->updateByPk($id, array('checked' => 1);
...
<?php
return array(
...
'components' => array(
...
'db' => array(
...
'enableProfiling' => true,
'enableParamLogging' => true,
),
@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'), // 追加
@jamband
jamband / main.php
Last active September 28, 2015 10:38
<head>
...
<?php echo Yii::app()->bootstrap->registerBootstrap(); ?>
</head>
@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 / 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 / main.php
Last active September 28, 2015 10:38
<?php
return array(
...
'components' => array(
'cache' => array(
'class' => 'CFileCache',
),
...
'db' => array(
...
@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,
<?php
class UserIdentity extends CUserIdentity
{
private $id;
public function authenticate()
{
$model = User::model()->findByAttributes(array(
'username' => $this->username,
));