I create a action helper file path is
C:\xampp\htdocs\ecom\application\controllers\helpers
file name :Inputdata.php
class Zend_Controller_Action_Helper_Inputdata extends Zend_Controller_Action_Helper_Abstract
{
function Inputdata()
{
return $this;
}
function fetch_db_value($var)
{
if(get_magic_quotes_gpc()==0) {
return is_array($var) ? array_map(array($this,'fetch_db_value'), $var) : nl2br(stripslashes(trim($var)));
}else {
return is_array($var) ? array_map(array($this,'fetch_db_value'), $var) : nl2br(trim($var));
}
}
}
I am calling this function on controller giving output proper like :
$dbData=$this->_helper->Inputdata->fetch_db_value($dbData);
I have also a view helper, path is
C:\xampp\htdocs\ecom\application\views\helpers
file name : Comman.php
class Zend_View_Helper_Comman
{
public function displayProducts($res){
# Res is a array
foreach($res as $val){
# $val also is sub array of array $res
$val=$this->_helper->Inputdata->fetch_db_value($val);
print_r($val)
}
}
}
this function
$this->_helper->Inputdata->fetch_db_value
is giving error
- any idea about syntax how to user action helper custom function in view helper custom function
- syntax how call function displayProducts() on controller