zend-framework

Eclipse PDT + Code completion not working at all

大城市里の小女人 提交于 2020-01-01 06:25:49
问题 I wanted to start a new Zend project, and currently I'm facing some issues regarding Eclipse PDT... My problem is, that the code completion in Eclipse for PHP does not work at all. I tried a lot of different tutorials etc, for example making a new project and import the files; making a new workspace and import projects there; almost every possible combination of buildpath settings and library imports; deleting several files in .metadata (you will find lots of tutorials like this if you google

Eclipse PDT + Code completion not working at all

萝らか妹 提交于 2020-01-01 06:25:22
问题 I wanted to start a new Zend project, and currently I'm facing some issues regarding Eclipse PDT... My problem is, that the code completion in Eclipse for PHP does not work at all. I tried a lot of different tutorials etc, for example making a new project and import the files; making a new workspace and import projects there; almost every possible combination of buildpath settings and library imports; deleting several files in .metadata (you will find lots of tutorials like this if you google

Zend_Form - The mimetype of file 'foto.jpg' could not be detected

独自空忆成欢 提交于 2020-01-01 05:35:10
问题 I have a Zend_Form with file element like this: ->addElement('file', 'image', array( 'required' => false, 'label' => 'Venue Image', 'validators' => array( array('IsImage', false), array('Size', false, '2097152'), array('Upload', false), ), )) And when I'm using localhost the image is uploaded successfully. But when I move to my hosting the validation error shows for image field. The mimetype of file 'foto.jpg' could not be detected. What can be the reason of this? 回答1: same thing happened to

Redirecting user back to originally desired URL after login

放肆的年华 提交于 2020-01-01 05:19:07
问题 Example: User is not logged in User has items in their shopping cart User goes to /checkout User is redirected to the /login page User logs in successfully and should be redirected back to the /checkout page How does the login action know to redirect the user to checkout in this case? I want this to work in many different situations not just /checkout. 回答1: Would a query string parameter in the login page be enough? eg: www.example.com/Login.php?returnUrl=[someUrl] After the authentication is

get current page url and change action

牧云@^-^@ 提交于 2020-01-01 05:07:08
问题 I need to give current page url and change action url. After that I want echo that in view file. I want do these in view file, not controller! Do you have any idea? 回答1: You can get current page url as follows: $uri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri(); // or using userAgent view helper: $uri = $this->userAgent()->getServerValue('request_uri'); The view helper $this->userAgent() returns an instance of Zend_Http_UserAgent that can provide you with many useful

get current page url and change action

﹥>﹥吖頭↗ 提交于 2020-01-01 05:07:05
问题 I need to give current page url and change action url. After that I want echo that in view file. I want do these in view file, not controller! Do you have any idea? 回答1: You can get current page url as follows: $uri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri(); // or using userAgent view helper: $uri = $this->userAgent()->getServerValue('request_uri'); The view helper $this->userAgent() returns an instance of Zend_Http_UserAgent that can provide you with many useful

Error reporting in zend framework

十年热恋 提交于 2020-01-01 04:28:20
问题 am having trouble with reporting errors in zend framework, errors messages are not displayed on the browser and i recive error's like this: An error occurred Application error However i already use those configuration in my application.ini file: phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 phpSettings.track_errors = 1 phpSettings.error_reporting = E_ALL Thanks in advance :D 回答1: The settings you are mentioning are php error management, whereas what you are looking for

How to handle mobile devices in Zend Framework?

好久不见. 提交于 2020-01-01 03:18:07
问题 I've taken over a nightmare of a project! I'm moving a very poorly written site and moving it slowly into a Zend Framework application. Unfortunately I have no time to do the remedial work to make this even bearable (maybe a model or two). I have now been told that it is soon to have mobile version of the site and the proposal has been to clone the old site and work with that. In an attempt to not work on different versions of the same crap and buy myself some time I proposed that the ZF site

Matching Multiple URLs with parameters using Zend_Controller_Router_Route_Regex in Zend Framework

故事扮演 提交于 2020-01-01 02:48:31
问题 i am developing a Rest Controller with Zend and i am confused with the mapping of urls to the Router. Basically i read about Zend Router and i could not plan my urls in order to satisfy the mentioned routes. These are some of my urls that should be mapped to Routers. http://localhost/api/v1/tags.xml http://localhost/api/v1/tags.xml?abc=true (param: abc=true) http://localhost/api/v1/tags/123456.xml (param: 123456.xml) http://localhost/api/v1/tags/123456/pings.xml (params: 123456, pings.xml)

setIntegrityCheck in Zend Selects with joins

落爺英雄遲暮 提交于 2020-01-01 02:33:05
问题 I was looking at some questions that ask how to do joins in Zend Framework queries, but the answer is always something like "just do setIntegrityCheck(FALSE) ". My question is: why do I need to do this? It seems to me disabling "integrity checks" is not the proper way of making this work. In my particular case, I'm using a MySQL database with some InnoDB tables with foreign keys, so for example: CREATE TABLE IF NOT EXISTS `tableA` ( `id` CHAR(6), `name` VARCHAR(255), PRIMARY KEY (`id`) )