Tag Archives: zend

用PHP处理中文PDF

因项目需要,现在想在服务器端动态生成PDF文件,已一个PDF为模板,然后把所需的数据动态填入。 本来在使用zend framework,因此很直接的就使用zend_pdf类来进行测试,代码实现如下: $pdf = Zend_Pdf::load($this->view->config->offline->template); $pdf->pages = array_reverse($pdf->pages); $style = new Zend_Pdf_Style(); $font = Zend_Pdf_Font::fontWithPath($this->view->config->offline->font, ( Zend_Pdf_Font::EMBED_DONT_SUBSET)); $pdf->pages[0]->setFont($font, 10); $pdf->pages[0]->saveGS(); //datalist $pdf->pages[0]->drawText(str_replace(“;”,”\n”,$datalist), 100, 570,”UTF-8″); //project $pdf->pages[0]->drawText($formData['project'], 100, 430,”UTF-8″); $pdf->pages[0]->drawText($formData['realname'], 100, 78,”UTF-8″); $pdf->pages[0]->drawText($formData['realname'], 130, 590,”UTF-8″); $pdf->pages[0]->drawText($formData['unit'], 95, 58,”UTF-8″); $pdf->pages[0]->drawText($formData['address'], 285, … Continue reading

Posted in Program | Tagged , , , , , , | 1 Comment

ubuntu hardy下使用zend framework

安装: sudo aptitude install zend-framework 补充操作: 1 添加Zend符号连接 sudo ln -s /usr/share/php/libzend-framework-php/Zend /usr/share/php/Zend 2 修补中文EMAIL的subject乱码 参考http://framework.zend.com/issues/browse/ZF-2532

Posted in Linux | Tagged , , , , , | 1 Comment

use bcspamblock in zend form

I want to integrate the bcspamblock and zend form, so first to do: 为了能自动防止机器人攻击,打算把bcspamblock整合到zend_form中。 1 创建element_bcSpamBlock.php文件, <?php class element_bcSpamBlock extends Zend_Form_Element_Xhtml{ /** * Default form view helper to use for rendering * @var string */ public $helper = ‘bcSpamBlock’; } … Continue reading

Posted in Computer | Tagged , , , | Leave a comment

PHP的Framework

很长时间没有关注PHP,今天无意中点到javaeye.com,发现其已经改版,使用了ruby on rails框架技术,做得很好,然后又看到了还有php相关的框架,最近最近一段时间在PHP的世界里也出现了很多框架。作为php的发行公司,Zend自己也推出了一个框架,简称为ZF,目前最新的稳定版本还是0.2。觉得php的动作有点慢了,应该在php5推出后,要是能紧跟就推出几个框架系统,那对于php世界应该有非常大的推动!不过,虽然动作慢了一些,但是已经有了很多的php框架发展起来了。粗粗阅读了zf的文档后,发现框架的功能还是蛮丰富的,但是ZF目前还是有相当多的进步空间的,就是说,目前还是有一些缺点的。 一些framework的比较: http://www.mustap.com/phpzone_post_73_top-10-php-mvc-frameworks http://www.phpit.net/article/ten-different-php-frameworks/ http://www.5itag.com/viewtopic.php/177 seagull感觉像是一个大的CMS系统 ZF感觉像是一个库,或者就是pear 最后看了symfony的manual,感觉symfony相当好,不过也有缺陷,就是配置太麻烦了。 在symfony中,用Propel实现了OR映射,支持多种数据库,包括mysql,sqlserver,pgsql,sqlite,oracle。 感觉这套框架和zend framework有很大不同,对我来说,symfony要好于zf。 还支持schema, or map, paging, multitype databases, … Conclusion: 首选symfony,其次cakephp,最后再考虑zf。当然还可以考虑seagull。

Posted in Program | Tagged , , , , , | Leave a comment