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);


Monday, August 25, 2014

Steps to install vagrant on windows system


This will help you to work with Virtual machines.. and helps us to work with Git


A) VirtalBox Dwonlad and install

B) Vagrant Download and install

Restart the system

Goto command line prompt

Create the Folder in your system using mkdir

1.. Start the vagrant
vagrant init

This command will create the config files

2.. Coping the vagrant from server. this is installing the Ubuntu 

vagrant box add precise32   http://files.vagrantup.com/precise32.box

3.. Now change the following line in the config file
box to prcecise32 in vagrant config

4.. Now the time to boot the new Ubuntu

vagrant up

5. This command will helps to stop the ubuntu

vagrant suspend

6. This command will helps to reboot the ubuntu
vagrant reload
 
 

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...