English 中文(简体)
1. 生成口号文件的伊伊框架
原标题:Yii Framework generating ms-word documents
最佳回答

教养。 这是必须做的。 问题是,我正在发出阿贾克斯呼吁。 没有问题,而是使用简单的链接。

View:
echo CHtml::link( Generate Word , array( Calculator/generateWord ));

Controller:
    public function actionGenerateWord() {
    $var = "Hello World!";
    $div = $this->renderPartial( graphs/word , array( var =>$var), true);
    header("Pragma: no-cache");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Cache-Control: private", false);
    header("Content-type: application/vnd.ms-word");
    header("Content-Disposition: attachment; filename="test.doc");
    header("Content-Transfer-Encoding: binary");
    ob_clean();
    flush();
    echo $div;
    Yii::app()->end();
}

Rendered view:
<table>
    <tr>
        <td>This is just a test</td>
    </tr>
    <tr>
        <td><?php echo $var; ?></td>
    </tr>
</table>
问题回答

暂无回答




相关问题
Natural language rendering

Do you know any frameworks that implement natural language rendering concept ? I ve found several NLP oriented frameworks like Anthelope or Open NLP but they have only parsers but not renderers or ...

PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

Why does stack get truncated in Exception.StackTrace?

Why does the high part of the stack (in Exception.StackTrace) gets truncated? Let s see a simple example: public void ExternalMethod() { InternalMethod(); } public void InternalMethod() { try ...

Finding the correct Python framework with cmake

I am using the macports version of python on a Snow Leopard computer, and using cmake to build a cross-platform extension to it. I search for the python interpreter and libraries on the system using ...

edit profile from frontend - symfony

I succeeded to create a register form, and now users can register my site. But I can t create a form where users can edit their profile. I have sf_guard_user and sf_guard_user_profile in my schema....

MVC evolution and improvements

I just found the MVC was initially proposed in 88 [here is the pdf file] but unfortunately ASP.NET just recently implement it. Do you know which is the most used MVC design pattern in the our days ...

热门标签