zend-framework

Updating Dojo Dijit FilteringSelect's store with asynchonous data

拈花ヽ惹草 提交于 2019-12-08 11:39:27
问题 I'm using Zend + Dojo form in an intranet context. We need to update a list of counties when the selected state is changed on a form. With HTML you would just parse the json response (or just provide a html fragment of options) and update the innerhtml of the select. However, doing so in Dojo has proved to be prohibitively complex. In short, I have defined a generic method that allows you to set an onBlur update to a form field. This links to a Controller action that calls the database with a

How get basepath from model or helper en Zend Framework 3

喜欢而已 提交于 2019-12-08 11:17:28
问题 I recently decided to use Zend Framework 3 after 3 years of using Zend Framework 1. This decision has given me headaches, Zend 3 instead of making things easier made things more difficult. In Zend 1, I customize the url for the selected template in the database as follows: public function getUrl(string $file = '') { if($this->_helperBaseUrl === null) { $this->_helperBaseUrl = new Zend_View_Helper_BaseUrl(); } return $this->_helperBaseUrl->baseUrl($file); } public function getSkinUrl(string

How to add attributes (id for example) to options of Zend_Form_Element_Select?

风格不统一 提交于 2019-12-08 11:16:53
问题 I need to add custom attributes (id, class) to options of Zend_Form_Element_Select . How can I do that? 回答1: You can pass in an "attribs" array when instantiating the element. For example: $form->addElement('select', 'type', array( 'label' => 'Label', 'multioptions' => $some_array, 'attribs' => array('class' => 'selector', 'id' => 'whatever') )); 回答2: AFAIK it's not possible to add ids to select's options. Option would be implementing your own viewHelper and adding this functionality. But

Best practice zend framework + faceBook Api

南笙酒味 提交于 2019-12-08 11:15:26
问题 What is better way to integrate facebook api, in zend framework, for login I can implement Zend_Auth_Adapter_Interface but I found something like Zend_Service_Twitter, and thinking if I should implement Zend_Service_interface and what are the odds, sorry haven't looked at the architecture of Zend_Service yet, but any advice would be appreciated and would save me time from going to wrong direction 回答1: While a proposal for a Zend_Service_Facebook exists, the developer didn't release anything

Youtube Zend Api Function Interrupts Script

醉酒当歌 提交于 2019-12-08 11:10:50
问题 This is the code: ... require_once 'Zend/Loader.php'; // the Zend dir must be in your include_path Zend_Loader::loadClass('Zend_Gdata_YouTube'); Zend_Loader::loadClass('Zend_Uri_Http'); $yt = new Zend_Gdata_YouTube(); $videoEntry = $yt->getVideoEntry($id_video); .... In this script's few lines, SOMETIMES (I didn't understand why this keep happening just some times, and not in others, seemingly random) Zend_Gdata_YouTube() or getVideoEntry($id_video) doesn't return, and the script dies. In the

Zend Error controller stopped working for 500

醉酒当歌 提交于 2019-12-08 11:00:23
问题 My Zend application was running fine until today, when I changed something which caused the error controller to stop working. I have debugged every part of the code but I can not find any traces as to why is it happening If I produce a 404 error, the error controller runs perfectly. But in case of 500, the control does not go to error controller. I have tried many things but am still unable to find out what's wrong. I have searched the internet but people who encountered this problem, seemed

$this->getInvokeArg('bootstrap')->getOptions(); fails when called from Zend Helper file - why?

▼魔方 西西 提交于 2019-12-08 10:50:52
问题 using ... $this->getInvokeArg('bootstrap')->getOptions(); .. to retrieve my config settings from application.ini (using Zend Framework 1.11). this is failing when called from a Zend Helper file but works when called in a controller why? 回答1: The getInvokeArg() method exists for controllers (classes extending Zend_Controller_Action ), but is not available for action helpers (classes extending Zend_Controller_Action_Helper_Abstract - I suppose that is what you mean with "Zend Helper file"). You

Zend Framework open id extensions with google

[亡魂溺海] 提交于 2019-12-08 10:37:46
问题 How to use openid extensions with google? I have something like this, I allready applied some patches which are basically the same as here: http://ak33m.com/?p=71 It does work without extensions? $extensions = new Zend_OpenId_Extension_Sreg(array( 'nickname' => false, 'email' => true, 'fullname' => false ), null, '1.1' ); if ($form->isValid($post)) { $open_id_adapter = new App_Auth_Adapter_OpenId($post['openid_identifier'],null, null, null, $extensions); $result = $auth->authenticate($open_id

Zend mod rewrite not working

徘徊边缘 提交于 2019-12-08 10:28:52
问题 Zend mod rewrite seems to be not working. mysite/index.php/controller/action works, so it must be the mod-rewrite. I verified using the phpinfo that it is loading. Here is my .htacess file: SetEnv APPLICATION_ENV development RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] 回答1: Is your .htaccess being called? Check in the main apache config that

Default_Bootstrap overrides Admin_Bootstrap

家住魔仙堡 提交于 2019-12-08 10:23:36
问题 In the Admin module installation Layout and Navigation of Default module application/modules/default/Bottstrap.php <?php class Default_Bootstrap extends Zend_Application_Module_Bootstrap { protected function _initNavigation() { $layout = Zend_Layout::startMvc()->setLayout('layout'); $config = new Zend_Config_Xml(APPLICATION_PATH.'/configs/navigation.xml','nav'); $navigation = new Zend_Navigation($config); Zend_Registry::set('Zend_Navigation', $navigation); } } application/modules/admin