Created
August 27, 2010 10:04
-
-
Save koshiaaaaan/553133 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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