zend-framework

How to set the table collation to utf_general_ci using doctrine2

你。 提交于 2019-12-11 11:15:52
问题 Today I got the following error in an application which uses doctrine2 Message: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_unicode_ci,COERCIBLE) for operation 'like' I checked with phpmyadmin that the collation of the table is latin1_swedish_ci. Within my application I configured doctrine to use utf8 $em->getEventManager()->addEventSubscriber(new \Doctrine\DBAL\Event\Listeners\MysqlSessionInit('utf8', 'utf8_unicode_ci')); My database

How to redirect Zend login form in a fancbox iframe with PHP (without any JS) only on ***successful*** login

♀尐吖头ヾ 提交于 2019-12-11 10:58:24
问题 Using only PHP (i.e. no JS), how do you redirect a Zend form in a fancybox iframe to its parent page, only if the form was successful? For instance, I set setAttrib("target","_parent") in the Zend form, but it forces the submit action to redirect on the iframe, and not the parent page. I want it to return to the parent page only if the submit action is unsuccessful. If login is not successful, it stays on the fancybox iframe successfully displaying error message. I am using Zend Framework.

Which is better: A new controller to send POST arguments or use the current one? Zend Framework 2

こ雲淡風輕ζ 提交于 2019-12-11 10:50:05
问题 What type of API is this? This is a followup question regarding an API question I had. I am using Zend Framework 2. zf-skeleton/module/MyApplication/src/MyApplication/Controller/IndexController.php public function submitAction() { $myForm = new MyForm(); $myForm->get('submit')->setValue('Add'); $request = $this->getRequest(); if ($request->isPost()) { $myModel = new MyModel(); $myForm->setInputFilter($myModel->getInputFilter()); $myForm->setData($request->getPost()); if ($myForm->isValid()) {

Populate a HTML form with Zend Framework session

吃可爱长大的小学妹 提交于 2019-12-11 10:32:44
问题 I'm trying to populate a HTML form with data saved in session. This is what i've done so far but it's not working: In my controller: $sessionErrorForm = new Zend_Session_Namespace('errorForm'); $sessionErrorForm->prenom = $form['prenom']; $this->_redirect('/inscription'); In my view, i need to display something in the value field if a session exists: <div><input type="text" name="prenom" value="<?php if (isset($sessionErrorForm->prenom)): echo $sessionErrorForm->prenom; endif;?>" title=

Zend google Calendar access not working anymore

时光毁灭记忆、已成空白 提交于 2019-12-11 10:29:54
问题 I have used the Zend framework to access a google calendar for about 1 year. Today, all of a sudden the Zend command getCalendarEventFeed() throws an error: HTTP/1.1 403 Forbidden Content-type: text/html; charset=UTF-8 Date: Mon, 17 Nov 2014 20:43:36 GMT Expires: Mon, 17 Nov 2014 20:43:36 GMT Cache-control: private, max-age=0 X-content-type-options: nosniff X-frame-options: SAMEORIGIN X-xss-protection: 1; mode=block Server: GSE Alternate-protocol: 443:quic,p=0.01 Connection: close Yesterday

Using a functions script in Zend framework

孤街浪徒 提交于 2019-12-11 10:27:20
问题 I have a doubt about doing something or not in order to keep the good practices in Zend Framework. Lots of times I need to use some functions like: http://www.paulferrett.com/2009/php-camel-case-functions/ or another around the application. The problem is that As i need it on the whole project I can not define as a method of a model, so I tried to use it as helpers. Now I do not want to use this as helpers because I thing it's not a good practice using view helpers in controllers or models. I

Accessing object's properties like if the objects were arrays

跟風遠走 提交于 2019-12-11 10:26:51
问题 Is it possible to access object's properties, when you don't know just how their names will be written? My problem is that when a query returns Zend_Db_Table_Rowset_Abstract object, there are some fields with names like "name_fr", "name_en", "name_au". I want to access either of them according to the current language used in the application. To achieve this I write the code this way: $result = $myModel->fetchAll($query)->current(); $row = $result->toArray(); echo 'Your name is '.$row['name_'.

Zend application and bootstrap as non mvc

为君一笑 提交于 2019-12-11 10:09:48
问题 Is it possible to use zend_application and zend_bootstrap as non mvc? I'd like to use them but without the zend_view. 回答1: yes you can. there is several way if you don't want to use zend view don't invoke run() method of zend application, so request will not hit your zend controller, and no zend view will be instantiated : $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $application->bootstrap(); disable view render & layout at controller

Zend Framework Hostname Routes: Routing while ignoring subdomains

送分小仙女□ 提交于 2019-12-11 10:09:02
问题 So I want to create a Zend_Controller_Router_Route_Hostname that matches the following: example.com www.example.com stage.example.com dev.example.com andrew.dev.example.com joe.dev.example.com I can't seem to figure out how to create a route that can match all these things. There can be multiple subdomains before "example.com", so everything before it doesn't really matter. Here's what I have so far: $hostnameRoute = new Zend_Controller_Router_Route_Hostname(':sandbox.:environment.example.com

Working with Zend Session Namespaces across multiple requests

我只是一个虾纸丫 提交于 2019-12-11 10:04:12
问题 Maybe I'm just not seeing it, but is there any other way to access a previously created session namespace, other than calling $_SESSION directly? Besides the fact that I really don't want to do this, the Zend documentation also advises against this: while $_SESSION is still available in PHP's global namespace, developers should refrain from directly accessing it, so that Zend_Session and Zend_Session_Namespace can most effectively and securely provide its suite of session related