Pages

Showing posts with label helper. Show all posts
Showing posts with label helper. Show all posts

Sunday, June 9, 2013

Cakephp 2.0-Create 0bserve field equivalent with new jshelper

Many things have changed in v2.0 of cakephp removal of ajaxhelper is one of them in its plce we have a new helper called jshelper() to perform similar tasks here is how to use observe field with jshelper in cakephp 2.x


 <?php  
 echo $this->Js->get('#category')->event->('change',$this->JS->request(array(  
 'controller'=>'contributers',  
 'action'=>'changevideos'),  
 array(  
 'update'=>'#videocontainer',  
 'async'=>true,  
 'dataExpression'=>true,  
 'method'=>Post,  
 'data'=>$(this).serialize()'),  
 false))  
 ?>   

Where #category is the id of element which fires event and #videocontainer is the id of div which is updated of data from controller "contributors" and its action "changevideos"

Sunday, May 12, 2013

Zend-Adding/Appending an element in a control in block

$form->submit->setDecorators(

 array(
             'ViewHelper',
              array(
                   array('data'=>'Html Tag' ),
                   array('placement'=>Zend_Form_Decorator_Abstract::PREPEND),
                    'tag'=>'span',
                    'class'=>'wp_submit'
                      ),
               array(
                    array(array('data'=>'Html Tag')),
                    array('tag'=>'span','class'=>'newspan')
                      )
        )

)

Sunday, July 8, 2012

CakeTime Utility class/TimeHelper in Cakephp 2.0

Use CakeTime Utility class as follows
App::import("CakeTime",'utility')
Time helper no more works in controller from cakephp 2.0 onwords.