Monthly Archives: February 2014

Summary of Good REST Api Design

Summary of points about good RESTful API design from below talk: Definition: Representational state transfer (REST) or RESTful Web services are one way of providing interoperability between computer systems on the Internet. REST-compliant Web services allow requesting systems to access … Continue reading

Posted in General, Web development | Tagged | Leave a comment

Yii Built In functions – Generic

// For dropdown list $list=CHtml::listData(SysState::model()->findAll(), ‘state_id’, ‘state_name’); echo $form->dropDownList($model,’state_id’, $list, array(’empty’=>’Select state’)); // dynamic dropdown populate Below lines create the country dropdown which updates state dropdown The above code updates the below line Called url will have the below code … Continue reading

Posted in PHP | Leave a comment

Yii DB built in functions – Reference

Quick reference – Yii inbuilt functions – DB related —————————————————- ###### Active Record functions: ############ Different ways to query // 1st way $criteria=new CDbCriteria; $criteria->select=’title’; // only select the ‘title’ column $criteria->condition=’postID=:postID’; $criteria->params=array(‘:postID’=>10); $post=Post::model()->find($criteria); // 2nd way $post=Post::model()->find(array( ‘select’=>’title’, ‘condition’=>’postID=:postID’, … Continue reading

Posted in PHP | Leave a comment