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
abstract class Awk extends CComponent | |
{ | |
public $filename; | |
public $fieldSeparator = ';'; | |
protected $data = array(); | |
protected $cntRows = 0; | |
abstract public function rules(); |
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 Configuration extends \CConfiguration | |
{ | |
/** | |
* usage: $configuration->get('contact.person.firstname'); | |
*/ | |
public function get($path, $default = null) | |
{ |
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 ShortCodeWidget extends COutputProcessor | |
{ | |
public $purifyOutput = false; | |
private $codes; | |
public function processOutput($output) | |
{ |
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 InstallCommand extends CConsoleCommand | |
{ | |
public function actionIndex() | |
{ | |
$this->createDir('images.cache'); | |
$this->createDir('images.cache.thumbnails'); | |
$tables = Yii::app()->db->schema->getTableNames(); |
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 | |
$this->widget('CMaskedTextField', array( | |
'model' => $model, | |
'attribute' => 'birthday', | |
'mask' => '99.99.9999', | |
'htmlOptions' => array('size' => 32) | |
)); | |
public function beforeSave() |
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 | |
//table post (id, title) | |
//table category (id, name) | |
//table post_category (postId, categoryId) | |
//class Post extends CActiveRecord | |
public function relations() | |
{ | |
return array( |
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 | |
'components' => array( | |
'messages' => array( | |
'onMissingTranslation' => function ($event) { | |
echo sprintf('missing Translation: %s.%s.%s', $event->language, $event->category, $event->message); | |
exit; | |
} | |
) | |
) |
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 | |
function getController() | |
{ | |
static $controller = null; | |
if ($controller == null) { | |
$tmp = Yii::app()->createController('site/index'); | |
$controller = $tmp[0]; | |
$controller->init(); |
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 UserIdentity extends CUserIdentity | |
{ | |
private $_id; | |
public function authenticate() | |
{ | |
$username = strtolower($this->username); | |
$user = User::model()->find('LOWER(username) = ?', array($username)); |
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 | |
$tables = Yii::app()->db->schema->getTableNames(); | |
foreach ($tables as $table) { | |
Yii::app()->db->createCommand()->dropTable($table); | |
} |