This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
'commandMap' => array( | |
'deleteexpireduser' => array( | |
'class' => 'application.modules.user.commands.DeleteExpiredUserCommand', | |
), | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Register extends User | |
{ | |
/** | |
* @var string パスワード(確認) | |
*/ | |
public $verifyPassword; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Frontend Register class file. | |
*/ | |
class Register extends User | |
{ | |
... | |
public function attributeLabels() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class WordTest extends WebTestCase | |
{ | |
public $fixtures = array( | |
'words' => 'Word', | |
'users' => 'User', | |
); | |
public function test_index() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Frontend WordController class file. | |
*/ | |
class WordController extends Controller | |
{ | |
/** | |
* @see CController::accessRules() | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Word extends ActiveRecord | |
{ | |
... | |
/** | |
* Gets all models. | |
* @param mixed $sort null sorting strings | |
* @param mixed $q null searching strings | |
* @return array pagination object and all models | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 1. /protected/components/MyFormatter.php を作成。CFormatter を extends する | |
* 2. format から始まる名前で独自のメソッドを追加 | |
*/ | |
class MyFormatter extends CFormatter | |
{ | |
public function formatBold($val) | |
{ | |
return '<b>' . $val . '</b>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* LoginAttempt class file. | |
* | |
* The followings are the available columns in table 'login_attempt': | |
* @property integer $id | |
* @property string $ip | |
* @property string $login | |
* @property integer $create_time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TestCommand extends CConsoleCommand | |
{ | |
public function run() | |
{ | |
$c = new CDbCriteria(); | |
$model = new Hoge(); | |
$model->name = 'test' . $model->count($c); | |
$model->save(false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class LoginAttempt extends ActiveRecord | |
{ | |
const LOGIN_ATTEMPT_LIMIT = 5; // ログイン試行回数のリミット | |
const BANNED_IP_EXPIRATION_TIME = '+1 hour'; // この場合は禁止されてから一時間経たないとログインできない | |
... | |
/** | |
* @see CActiveRecord::beforeSave() | |
*/ |