2012年11月22日

摘要: 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); 阅读全文
posted @ 2012-11-22 16:07 技术员 阅读(908) 评论(0) 推荐(0) 编辑

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);问题原因不明! 阅读全文
posted @ 2012-11-16 10:21 技术员 阅读(206) 评论(0) 推荐(0) 编辑

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 阅读全文
posted @ 2012-11-10 15:17 技术员 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 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& 阅读全文
posted @ 2012-11-10 15:01 技术员 阅读(211) 评论(0) 推荐(0) 编辑

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... 阅读全文
posted @ 2012-10-15 17:25 技术员 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Url Manager A.User-friendly URLSarray( ...... 'components'=>array( ...... 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=> false, 'urlFormat'=> false, 'rules'=>array( '<controller:\w+>/<id:\d+>' 阅读全文
posted @ 2012-10-15 17:04 技术员 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2012-10-15 15:29 技术员 阅读(707) 评论(0) 推荐(0) 编辑

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... 阅读全文
posted @ 2010-01-26 12:52 技术员 阅读(809) 评论(0) 推荐(0) 编辑

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... 阅读全文
posted @ 2009-08-10 14:20 技术员 阅读(423) 评论(0) 推荐(0) 编辑
摘要: 鉴于国外优秀的博客在国内都被...找一个和技术相关的博客平台.于是这个博客就产生了.目的很明确: 就是把自己的心得和好的文章贴出来. 阅读全文
posted @ 2009-08-10 14:16 技术员 阅读(112) 评论(0) 推荐(0) 编辑

导航