db = $db; } static function addPaginator($data,$ctl,\Zend_Controller_Request_Abstract $request = NULL,$limit = 10) { if(empty($request)) { $request = $ctl->getRequest(); $page = $request->getParam('page'); $view = $ctl->view; }else{ $page = $request->getParam('page'); $view = $ctl; } $paginator = \Zend_Paginator::factory($data); $paginator->setCurrentPageNumber($page); $paginator->setItemCountPerPage($limit); $paginator->setView($view); \Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); $view->paginator = $paginator; } static function Msg($type,$content,$url=''){ $html = '
"; var_dump($data); echo ""; if($exit) { exit(); } } static function Post(\Zend_Controller_Action $ctl,$msg,$url=""){ if(empty($msg)) { return false; } if(!is_array($msg)) { $msg = array('content'=>$msg,'url'=>$url); } $helper = new \Zend_Controller_Action_HelperBroker($ctl); $helper->layout->setLayout('layout'); $helper->viewRenderer->setNoRender(); echo $ctl->view->partial('post-message.phtml', $msg); return true; } static function getHostLink() { $protocol = "http"; if(strpos(strtolower($_SERVER['SERVER_PROTOCOL']),"https")) { $protocol = "https"; } return $protocol."://".$_SERVER['SERVER_NAME']; } }