zend-framework

Adobe Reader cannot open .pdf file created using mPDF in Zend Framework

房东的猫 提交于 2019-12-12 16:04:20
问题 I'm trying to generate a .pdf file using mPDF in a Zend Framework application, from the output of the action. Here is the code of my action: public function testAction() { $this->_helper->viewRenderer->setNoRender(); $this->_helper->layout->disableLayout(); $this->view->foo = 'bar'; $this->render(); $output = $this->getResponse()->getBody(); $layout = new Zend_Layout(); $layout->content = $output; $layout->setLayoutPath(dirname(dirname(__FILE__)) . '/views/layouts/'); $layout->setViewSuffix(

Zend Framework - Where should we place our custom Validators?

陌路散爱 提交于 2019-12-12 16:01:29
问题 We can read here how to write: http://framework.zend.com/manual/en/zend.validate.writing_validators.html class MyValid_Float extends Zend_Validate_Abstract { 1) Where should we place this? application/default/validators ? application/view/helpers/... ? 2) Do we have to register this somewhere on our application ? Update: Here's an example of my bootstrap: include_once 'config_root.php'; set_include_path ( $PATH ); require_once 'Initializer.php'; require_once "Zend/Loader.php"; require_once

Zend Auth locked session

折月煮酒 提交于 2019-12-12 15:36:57
问题 i nearly frustrated with how Zend handling session. here is my case. i write a auth plugin that always check the the user credential utilize Zend_Auth. and when invoke hasIdentity function from zend auth, it will automatically start the session. and the problem come when i have a long process that i need to execute. the session will lock the request until request completed. i try to release the lock by invoke Zend_Session::writeClose(false), so another request can be executed. but no way for

zend_call_method_with_N_params

試著忘記壹切 提交于 2019-12-12 15:06:15
问题 There are zend_call_method_with_0_params , zend_call_method_with_1_params and zend_call_method_with_2_params in PHP extension development. But how to call method with more than 2 params? 回答1: My previous answer was wrong. You have to use zend_call_function directly . See the body of zend_call_method. Basically you have to prepare a zend_fcall_info object first. The number of arguments should be stored in the fci.param_count field and fci.params should have an array with fci.param_count

How to selectively clear cache (using tags or other option) with Memchached backend and Zend Framework

旧城冷巷雨未停 提交于 2019-12-12 14:51:58
问题 We use Memcached and Zend Framework in our web project. Now, we need to clean cache selectively using tags as specified in Zend_Cache API. Unfortunately, memcached doesn't support tags. I have found these workarounds: Memcached-tag project. Has anybody tested it? How to implement it with Zend? Use wildchards like in this question, but it seems a bit confusing, less transparent and harder to implement with Zend. Use this implementation or this one, for supporting tags in Memcached, beeing

Zend Failed opening Zend/Application.php

≯℡__Kan透↙ 提交于 2019-12-12 14:12:55
问题 Ok, so I am relatively new to Zend. I have created a new application and started to build an authentication system based on a guide. However, the server is kicking out an Internal Server Error. Upon checking the PHP error logs I have been given the following two errors: [Thu Jul 19 10:26:40 2012] [error] [client 80.194.255.4] PHP Warning: require_once(Zend/Application.php): failed to open stream: No such file or directory in /home/www-data/zend.danielgroves.net/htdocs/public/index.php on line

accessing request parameters inside paginator partial

半城伤御伤魂 提交于 2019-12-12 14:11:38
问题 1)how do i access the search $keyword inside the paginator partial to create search freindly urls ? clearly, passing the keyword as $this->view->paginator->keyword doesnt work. 2) currently, the search button's name is also send as param . for eg when searching for 'a' the url becomes http://localhost/search/index/search/a/submit//page/2 . any way to stop this ? Search Form: <form id="search" method="get" action="/search"> <input id="searchfield" onClick="this.value=''" type="text" name=

PHPUnit, Using class consts to change State

∥☆過路亽.° 提交于 2019-12-12 14:03:04
问题 I'm learning Zend and also PHPUnit. Here is what I have below public function changeToIllegalState() { return array( array( Application_Model_SomeModel::FAIL ), array( Application_Model_SomeModel::SUCCESS ) ); } /** * @dataProvider changeToIllegalState * @expectedException IllegalStateChangeException */ public function testIllegalStateChangeGeneratesException( $state ) { $mapper = new Application_Model_Mapper_SomeModel(); $model = new Application_Model_SomeModel(); $model->changeState( $state

Mapping PHP and Flex Objects

半世苍凉 提交于 2019-12-12 13:29:53
问题 I am using ZendAMF for remoting. <?php error_reporting(E_ALL | E_STRICT); //error reporting, not needed require_once "Zend/Amf/Server.php"; //the zendAMF server require_once "process.php"; //our test class $server = new Zend_Amf_Server(); //declare the server $server->setClass("process"); //load our test-class to the server $server->setClassMap("Session", "Session"); echo($server->handle()); // needed to start the server ?> My Question is i have a ActionScript class Session and a PHP Class

Putting models in library directory in Zend Framework

纵然是瞬间 提交于 2019-12-12 13:20:53
问题 I want to put models outside module directory in Zend Framework. To be precise, in /library folder library/ models/ actors/ ActorsMapper.php Actor.php books/ BooksMapper.php Book.php INSTEAD OF application/ modules/ models/ actors/ ActorsMapper.php Actor.php books/ BooksMapper.php Book.php This is done so that I don't have to create separate model for each of the module I create. What configurations will I have to change? If you need more details, please ask. Thank you :) 回答1: First answer