zend-framework

Zend_Session : Clean $_SESSION before calling start

孤者浪人 提交于 2019-12-08 10:05:04
问题 Let's say a web application store an object of class My_Object in the php session, under the name 'myobject'. When I open another php application where this class doesn't exist, Zend_Session::start() throw an exception when attempting to unserialize My_Object. Thus, I need to clean the $_SESSION variable to get rid of 'myobject'. But to clean $_SESSION variable, I first need to call session_start() and once it has been called, Zend_Session::start() throws the following exception : Uncaught

Resolve view helper location from within the controller or form

时光怂恿深爱的人放手 提交于 2019-12-08 09:53:10
问题 I have a few view helpers that add JavaScript files when they're needed (for instance, so that only forms use CKEditor and such). My directory structure (simplified to include only the relevant files) is this: application --forms --Project AddIssue.php --modules --default --views --helpers JQueryUI.php Wysiwyg.php --project --controllers ProjectController.php --views --scripts --project version.phtml issueadd.phtml What I want to do: include CKEditor in the view project/project/issueadd

How to integrate dynamically JS code in success page in magento

天大地大妈咪最大 提交于 2019-12-08 09:51:32
I know that success.phtml is the file where I should put the code I want to execute, but I received from CJ this file which is not an html, its a php class. Question is very simple: I would like to know how can I integrate this file into the success.phtml after an order has been received.? Thank you class CommissionJunction extends Mage_Core_Helper_Data { /** * Get SKU, quantity, price and discount amount for each product in a given order * @param object $order * @return array */ private function _getOrderProductsList($order) { $orderItems = $order->getAllItems(); $purchasedSkus = array();

Unable to delete a record through Zend_Db_Table_Abstract->delete()

房东的猫 提交于 2019-12-08 09:36:54
问题 I am trying to delete a record through a delete action using zend framework Model. i am still unable to figure out why its not deleting and the $model->delete() always returns zero. (0) this is my delete action code. public function deleteAction() { if ($this->getRequest()->isGet()) { $id = $this->getRequest()->getParam('id'); if (!empty($id)) { $id = $this->getRequest()->getPost('id'); $post = new Application_Model_Post(); if ($post->delete($id)) { $this->_helper->flashMessenger->addMessage(

common constant variables in Zend Framework

為{幸葍}努か 提交于 2019-12-08 09:08:46
问题 Where is the best place to create a class that contain all the application constant variables ? is it : - Bootstrap - In the Application Common library for example : 1- When i retrieve an image name from a database if this record doesnt have an image , i want to put a default value somewhere so i can use it in my models ** a constants that i use in all my application so if i change it , i dont want to go back to all in my code and change it everywhere 回答1: application.ini is the best place

Zend_Form validator custom error message in INI configuration file

被刻印的时光 ゝ 提交于 2019-12-08 09:01:27
I am using INI files to manage my Zend_Form elements. Here's an example .ini file: form.action = "" form.method = "post form.elements.attribute_name.type = "text" form.elements.attribute_name.options.label = "Element Name" form.elements.attribute_name.options.validators.strlen.validator = "StringLength" form.elements.attribute_name.options.validators.strlen.options.min = "1" form.elements.attribute_name.options.validators.strlen.options.max = "50" form.elements.submit.type = "submit" form.elements.submit.options.name = "Go!" This element will throw the "strlen" error message as "XX is greater

Is it possible to integrate Doctrine 2 with Zend Framework 1.1x?

好久不见. 提交于 2019-12-08 08:47:06
问题 I'd really like to use and test Doctrine 2 and Zend Framework, but I don't where to start, and I don't know if both are compatible? Do you have any feedback? How could I integrate Doctrine 2 with Zend Framework 1.1x? Thanks in advance. 回答1: After a long day of search, I found two implementations which of one I liked much because of its documentation and simplicity. It is part of a Zend Framework extension called Bgy library, there is an Application Resource to help bootstraping both Web

ZendFatal error: Class 'Zend\Ldap\Ldap' not found

独自空忆成欢 提交于 2019-12-08 08:26:32
问题 So, i'm trying to make a Ldap authentication, following the docs in https://zf2.readthedocs.org/en/latest/user-guide/skeleton-application.html I just replace the 'Album' module with a 'Auth' module and use the sample code for Ldap autentication https://zf2.readthedocs.org/en/latest/modules/zend.authentication.adapter.ldap.html but i'm getting this error where Zend can't find the Ldap class when i submit the form with the login data. Fatal error: Class 'Zend\Ldap\Ldap' not found in C:\wamp\www

Zend_Form set action - Can it work w/ Zend application built in subdirectory?

放肆的年华 提交于 2019-12-08 08:18:03
问题 My application is being built in a subdirectory of my local server, that looks something like this: http://localhost/application/ The problem is that when I set the form action to "/form/save", the form routes to "localhost/form/save", which doesn't exist. If I set the form action to "/application/form/save", I get an error, because Zend uses the URL input in its Front_Controller to pick the modules, Controllers, and Actions to use for requests. Is there a simple way to have the base_url

Cant get the zend loader to load classes only under wamp

橙三吉。 提交于 2019-12-08 08:10:21
问题 I'm trying out the zend framework classes for the first time. I am interested in using some of the individual classes for now. Reading the documentation and some other q's here and in blogs I've tried three ways to load the classes //attempt 1 - using zend loader require_once('library\Zend\Loader.php'); Zend_Loader::loadClass('Zend_Date'); //attempt 2 - direct class load require_once('library\Zend\Date.php'); // attempt 3 - auto load set_include_path('D:\wamp\www\testPages\zend_test\library