Skip to content

Instantly share code, notes, and snippets.

@koshiaaaaan
Created August 27, 2010 10:04
Show Gist options
  • Save koshiaaaaan/553133 to your computer and use it in GitHub Desktop.
Save koshiaaaaan/553133 to your computer and use it in GitHub Desktop.
<?php
require_once 'Zend/View/Helper/Abstract.php';
class Juke_View_Helper_Request extends Zend_View_Helper_Abstract
{
public function request()
{
return $this ;
}
public function __call( $method, $args )
{
$request = Zend_Controller_Front::getInstance()->getRequest() ;
return call_user_func_array( array( $request, $method ), $args ) ;
}
public function getArrayPost()
{
$args = func_get_args() ;
$request = Zend_Controller_Front::getInstance()->getRequest() ;
$post = $request->getPost() ;
foreach( $args as $arg ) {
if( isset( $post[ $arg ] ) ) {
$post = $post[ $arg ] ;
} else {
return null ;
}
}
return $post ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment