JavaScript
- 2 ответа
- 0 вопросов
3
Вклад в тег
monthNamesShort
и monthNames.
$.datepicker.setDefaults( $.datepicker.regional[ "ru" ] );
$('#myDate').datepicker({
clickInput: true,
monthNamesShort: [ "Января", "Февраля", "Марта", "Апреля", "Мая", "Июня", "Июля", "Августа", "Сентября", "Октября", "Ноября", "Декабря" ],
dateFormat:"DD, d M, yy",
});
<div class="input-prepend">
<span class="add-on"><i class="icon-calendar"></i></span>
<input class="span5" id="myDate" type="text"></input>
</div>
'components'=>array(
...
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'/'=>'',
array('/aaa/default/index/id/58058', 'caseSensitive'=>false, 'pattern' => 'aaa', 'verb' => 'GET', 'parsingOnly' => true),
array('/bbb/default/index', 'caseSensitive'=>false, 'pattern' => 'bbb.php', 'verb' => 'GET', 'parsingOnly' => true),
array('/bbb/default/index', 'caseSensitive'=>false, 'pattern' => 'bbb', 'verb' => 'GET', 'parsingOnly' => true),
array('/ccc/default/index', 'caseSensitive'=>false, 'pattern' => 'ccc', 'verb' => 'GET', 'parsingOnly' => true),
),
),
),
'components'=>array(
...
'errorHandler' => array(
// use 'site/error' action to display errors
'errorAction' => 'site/error',
),
),
public function actionError()
{
$error=Yii::app()->errorHandler->error;
if($error) {
if(Yii::app()->request->isAjaxRequest){
echo $error['message'];
Yii::app()->end();
} else {
if(!empty($error['code']) && $error['code'] == 404 && !empty($error['traces'][0]['args'][0]))
{
echo 'Query : '.$error['traces'][0]['args'][0];
$this->redirect(array('bbb/index','str'=>$error['traces'][0]['args'][0]));
}
echo $error['message'];
}
}
location / {
try_files $uri $uri/ /index.php?$args;
root /var/www/site;
index index.php index.html index.htm;
}
location ~ \.php$ {
try_files $fastcgi_script_name =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass PollFPM;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/site$fastcgi_script_name;
}
protected function extractType($dbType)
{
if(strpos($dbType,'[')!==false || strpos($dbType,'char')!==false || strpos($dbType,'text')!==false)
$this->type='string';
else if(strpos($dbType,'bool')!==false)
$this->type='boolean';
else if(preg_match('/(real|float|double)/',$dbType))
$this->type='double';
else if(preg_match('/(integer|oid|serial|smallint)/',$dbType))
$this->type='integer';
else
$this->type='string';
}