Sign up to create your own snipts, or login.

Public snipts » robertbanh's snipts » zend The latest zend snipts from robertbanh.

showing 1-3 of 3 snipts for zend
  • Correct way to do Pagination in Zend
    <?
    //In other words, instead of this:
    
        $select= $this->db->select()->from( 'runz_miles', 'EMPL_NO')->where('empl_no = ?', 31713);
        $this->view->result = $this->db->fetchAll($sql);
        $paginator = Zend_Paginator::factory($this->view->result);
    
    //Do this:
    
        $select= $this->db->select()->from( 'runz_miles', 'EMPL_NO')->where('empl_no = ?', 31713);
        $paginator = Zend_Paginator::factory($select);
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Oct 13, 2009 at 9:59 a.m. EDT
  • Zend: Get controller and action in Controller
    <?
    // zend [debugging]
    // this will get the controller and action 
    // on the controller:
    
    	var_export($this->getRequest());
    	die();
    	echo $this->getRequest()->getParam('module');
    	echo $this->getRequest()->getParam('controller');
    	echo $this->getRequest()->getParam('action');
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Sep 14, 2009 at 8:55 a.m. EDT
  • Zend: Using URL helper inside a View Helper Method
    <?
    //Using URL helper inside a View Helper Method
    $link = $this->view->url(array(
    	'module'=>'default', 
    	'controller'=>'con',
    	'action'=>'details',
    	'f'=>'search',
    	'id'=>$id,
    	), '', true);
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Sep 14, 2009 at 8:52 a.m. EDT
Sign up to create your own snipts, or login.