Thursday, August 28, 2014

Model Object to result array in Yii


Yii CActiverecord methods findall, findAllByattributes always return object. if you want get the result as array. By you can get the dbcriteria use it in commanBuilder

$object = Message::model();
$object = $object ->getCommandBuilder()
               ->createFindCommand($object ->tableSchema, $object ->dbCriteria)
               ->queryAll();

print_r($object);


Bind Some Event to Element and trigger that function when click the element

Scenario: Suppose if we used same click event function in various web pages. if you want do some logic some page button for that need to re...