2011-08-09 15 views
-1

divテーブルに出力する$ dataにすべての情報を格納する "resultAction"という関数があります。PHPフォームデータをExcelまたはPDFにエクスポート

今、同じフォームデータをエクスポートしてExcelにエクスポートします。 "reportAction"という別の関数に同じフォームデータを渡したいのですが、失敗した$ dataを取り戻しています。

function resultAction() 
{ 
    for ($i = 0; $i < count($result); $i++) { 
     $data[$i]['device_type']  = $result[$i]['device_type']; 
     $data[$i]['region_name']  = $result[$i]['region_name']; 
    } 

    echo Zend_Json::encode($data); 
    sleep(2); 
    $this->_helper->viewRenderer->setNoRender(); 
    $this->_helper ->layout()->disableLayout(); 
    return $data; 
} 

function reportAction() { 
    $res = $this ->resultAction // here it fails 
} 
+0

を探しています。これらの関数は、あるクラスのメンバですか? – Mchl

+0

ちょっとコードを入れました。構文エラーを無視してください。 –

+0

私はZend_Frameword @Mchlが – yokoloko

答えて

1

あなたはすべてこのコードは、構文エラーの完全であるフォワード機能

function reportAction() { 
    $this->_forward('result'); // here it's not supposed to fail 
} 
+0

だと思っていますが、reportAction()は$ dataを返すresultActionを呼び出す必要があることを知っているでしょう。 –

+0

$ this - > _ forward ('結果');結果を呼び出すAction Zend Frameworkを使用していると思いますか? – yokoloko

関連する問題