This file contains 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 | |
namespace app\models; | |
use yii\base\Model; | |
use Yii; | |
/** | |
* Simplified model with validation rules. | |
* All characters are allowed (you want emojis in the password? Go ahead). |
This file contains 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 | |
$countries = [ | |
'AF' => Yii::t('app/countries', 'Afghanistan'), | |
'AL' => Yii::t('app/countries', 'Albania'), | |
'DZ' => Yii::t('app/countries', 'Algeria'), | |
'AS' => Yii::t('app/countries', 'American Samoa'), | |
'AD' => Yii::t('app/countries', 'Andorra'), | |
'AO' => Yii::t('app/countries', 'Angola'), | |
'AI' => Yii::t('app/countries', 'Anguilla'), |
This file contains 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
/** | |
* Join array elements with a string. | |
* This method works with multidimensional arrays. | |
* | |
* @param string|array $glue the string for the array to be joined with or | |
* the array itself if $array is null | |
* @param array|null $array array to implode or null if array is provided as | |
* first parameter. | |
* @return string imploded array | |
* @throws \yii\base\InvalidParamException |
This file contains 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 | |
return [ | |
'Africa/Abidjan', | |
'Africa/Accra', | |
'Africa/Addis_Ababa', | |
'Africa/Algiers', | |
'Africa/Asmara', | |
'Africa/Asmera', | |
'Africa/Bamako', |
This file contains 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 | |
/** | |
* CsNumberValidator class file. | |
* @copyright 2014 Paweł Bizley Brzozowski | |
*/ | |
/** | |
* CsNumberValidator is the same as CNumberValidator but allows comma instead of dot before decimals. | |
* So now 123,45 is valid number. |
This file contains 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 | |
// ISO 3166-1 alfa-2 | |
// Polish names of countries of the world | |
// Polskie nazwy krajów świata | |
$countries = [ | |
'AF' => 'Afganistan', | |
'AL' => 'Albania', | |
'DZ' => 'Algieria', | |
'AD' => 'Andora', | |
'AO' => 'Angola', |
This file contains 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 | |
$yii = dirname(__FILE__) . '/framework/yii.php'; | |
$config = dirname(__FILE__) . '/protected/config/main.php'; | |
if (isset($_SERVER['REMOTE_ADDR']) && in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1'))) { | |
defined('YII_DEBUG') or define('YII_DEBUG', true); | |
ini_set('display_errors', 'on'); | |
error_reporting(E_ALL); | |
} |
NewerOlder