zend-framework

PHPUnit and Zend Framework assertRedirectTo() issue

穿精又带淫゛_ 提交于 2019-12-12 12:38:08
问题 I'm having an issue with assertRedirectTo() in a test I have created, below is the code I have used: public function testLoggedInIndexAction() { $this->dispatch('/'); $this->assertController('index'); $this->resetResponse(); $this->request->setPost(array( 'type' => 'login', 'username' => 'root', 'password' => 'asdasd', )); $this->request->setMethod('POST'); $this->dispatch('/'); $this->assertRedirectTo('/feed/'); } You log in through / (index.php/) and submit post details there and the it

Tutorials For Database-Driven Routing in Zend Framework?

℡╲_俬逩灬. 提交于 2019-12-12 11:28:05
问题 I am working on a project that needs to use a database driven MVC scheme where the route to the controllers and views are controlled through a single database table. However, I haven't been able to find any tutorials that demonstrate this with a current version of the framework (they all appear to have been written several versions ago) and I was wondering if anyone has done something like this with a more recent version of the framework or if anyone knows of blogs or tutorials that discuss

How do I correctly create a Zend Feed?

若如初见. 提交于 2019-12-12 11:21:22
问题 I have successfully created a simple RSS feed, but entries keep coming back as unread and updated, and entries deleted from the client reappear everytime I ask mail to update the feed. What am I doing wrong? I use this simple function to create an rss feed: public static function getFeed($db) { $title = 'Latest feeds'; $feedUri = '/rss/'; //link from which feed is available $link = 'http://' . $_SERVER['HTTP_HOST'] . $feedUri; //create array according to structure defined in Zend_Feed

How to send to custom error pages Zend Framework?

橙三吉。 提交于 2019-12-12 11:16:44
问题 I have members that can be blocked and when the member is blocked I want to send them to a custom error page, how would I do that in zend framework? I tried throw new Zend_Controller_Dispatcher_Exception('Your message here'); but it doesn't say "your message here", it says "page not found" when I do this. here is my error controller. <?php class ErrorController extends Zend_Controller_Action { public function errorAction() { $errors = $this->_getParam('error_handler'); switch ($errors->type)

Zend_Pdf Add text link to pdf page

烂漫一生 提交于 2019-12-12 11:08:36
问题 Is it possible to add anchor text(link) in Zend_PDF page? I wasn't be able to find any information about this in Zend_Pdf online manual, or reading code, so I guess it is not possible. If there is way, please suggest! Thanks! 回答1: Disable border: ... $target = Zend_Pdf_Action_URI::create('http://example.com'); $annotation = Zend_Pdf_Annotation_Link::create(0,0,100,100,$target); $annotation->getResource()->Border = new Zend_Pdf_Element_Array(); $pdf->pages[0]->attachAnnotation($annotation); ..

Zend_Controller_Router_Exception: Route default is not defined

丶灬走出姿态 提交于 2019-12-12 10:54:05
问题 I'm trying to test a controller. Zend Tool has generated the following code: class Default_CarrinhoControllerTest extends Zend_Test_PHPUnit_ControllerTestCase { public function setUp() { $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini'); parent::setUp(); } public function testIndexAction() { $params = array('action' => 'index', 'controller' => 'Carrinho', 'module' => 'default'); $urlParams = $this->urlizeOptions($params); $url = $this->url

Disable Zend Autoloader

旧时模样 提交于 2019-12-12 10:26:00
问题 How can I disable the Zend_Loader_Autoloader? 回答1: You could manually force the Autoloader to unload, but this may lead to trouble with components depending on it being registered: make sure your other loader covers that. spl_autoload_unregister(array('Zend_Loader_Autoloader','autoload')); I stripped this from the constructor of Zend_Loader_Autoloader, and changed it to work outside of the class, and to unregister instead of register the loader. 回答2: If you're using the Zend_Application, in

Fatal error: Call to a member function toOptionArray() on a non-object

自古美人都是妖i 提交于 2019-12-12 10:21:36
问题 I am developing a payment method module in Magento. When I click payment methods menu in Configuration of Magento I get the below error Fatal error: Call to a member function toOptionArray() on a non-object in \xampp\htdocs\magento\app\code\core\Mage\Adminhtml\Block\System\Config\Form.php on line 421 Please see the below link for the code of module which I was developing Magento module Fatal error: Class 'Mage_Cashondelivery_Helper_Data' not found in \xampp\htdocs\magento\app\Mage.php on line

View Helper, Partial View or Something Else

给你一囗甜甜゛ 提交于 2019-12-12 09:53:39
问题 I am new to Zend Framework and I have a question about something I am trying to do. The main content of most pages of the application that I am working on will consist of 1 or more div elements that need to be styled the same. Here is an example of the HTML that I want to generate: <div id='admin-locations' class='panel'> <header class="panel-header"> <h2>Locations</h2> </header> <div class='panel-content'> <div id='locations-table' class='google-vis-table'></div> <form id='locations'> ... <

authentication using Zend_Http_Client

我只是一个虾纸丫 提交于 2019-12-12 09:48:31
问题 I'm trying to use Zend_Http_Client to make a simple post request on a site that requires authentication. Everything seems to be correct but I'm still getting a You are not authorized to view this page error. Any ideas what the problem might be? I'm certain the username and password are correct $client = new \Zend_Http_Client('http://ncmcrm/sales_summary/activity_range.asp'); $client->setHeaders('WWW-Authenticate', 'Negotiate'); $client->setParameterPost(array( 'from_day' => 1, 'from_month' =>