摘要:
Let's see the snippets first.jQuery$.ajax({ 'url': 'http://aptana-local/testobject/test1.php', 'dataType': 'json', "success": function(data){ alert(data); console.log(data); console.log(typeof data); }});PHP (test1.php)echo $this->_sendResponse($arr); 阅读全文
2012年11月22日
2012年11月16日
摘要:
环境:Yii 1.1.12 + PHP 5.3.3 + CentOS 6行为描述: 我试图使用一个纯数字作为SESSION的键值。(string)round(microtime(true) * 1000); // 此方法在CentOS 5上可以用。尽管前面已经强制使用字符,但仍然无法加入SESSION!不得已改为‘s' . round(microtime(true) * 1000);问题原因不明! 阅读全文
2012年11月10日
摘要:
Actaully we use this creating a text filed.$form->textField(CModel $model, string $attribute, array $htmlOptions=array ( ));Form reference.Generates a text field input for a model attribute. If the attribute has input error, the input field's CSS class will be appended witherrorCss. The defau 阅读全文
摘要:
How to use your own jQuery library in YII?We can use the following line to load Yii jQuery, but it's not always latest version of jQuery. Sometime we need to customize it.Yii::app()->clientScript->registerCoreScript('jquery');So add the following to config/main.php 'components& 阅读全文
2012年10月15日
摘要:
Just a snippet 1 class KPEnv 2 { 3 /** 4 * @param string $env 5 * @return boolean. 6 */ 7 public static function isValidEnv($env) 8 { 9 return in_array($env, array('dev', 'staging', 'live'));10 }11 12 /**13 * @param string $env14 * @return boo... 阅读全文
摘要:
Url Manager A.User-friendly URLSarray( ...... 'components'=>array( ...... 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=> false, 'urlFormat'=> false, 'rules'=>array( '<controller:\w+>/<id:\d+>' 阅读全文
摘要:
At the beginning, why we need migration?In a long time, PHP has no way to currently deploy a project at many server at same time with the exactly same database schema.Most time we have to dump database and import them to some othere server. If someone changed the database schema, we have to apply th 阅读全文
2010年1月26日
摘要:
1. 列出数据库所有用户自建表名. SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg%' AND tablename NOT LIKE 'sql_%' ORDER BY tablename;2. 列出所有序列:select relname from pg_class where relkind='S'; r... 阅读全文
2009年8月10日
摘要:
这是转贴的,原文如下:After much frustration, I found away to get the Ruby mysql Gem installed and talking to my MySQL serveron MAMP. Here's the steps I followed for MAMP 1.7.2:Install the regular MAMP 1.7.2 dmg... 阅读全文