zend-framework

Magento - How to query admin's role name?

心不动则不痛 提交于 2019-12-07 03:59:29
问题 I am trying to get the name of the role of the currently logged in admin. I can get the admin user, but I can't figure out how to query their role name. The Magento docs are weak =/ $usr = Mage::getSingleton('admin/session')->getUser(); Ideas anyone? 回答1: Spoke too soon... I got the role name as follows: $roleId = implode('', Mage::getSingleton('admin/session')->getUser()->getRoles()); $roleName = Mage::getModel('admin/roles')->load($roleId)->getRoleName(); 回答2: Using this code you will get

Page Load - White “flash” inbetween pages

你离开我真会死。 提交于 2019-12-07 03:46:24
问题 There are two websites, one live one under development. I am porting a site to Zend Framework (for maintainability/integration purposes). The original (live) site has seamless page loads - it will load, then update the content on the screen while keeping the background image, navigation etc on the page. The ported site (development) "flashes" completely white for a brief moment then all of the content appears simultaneously. From what I understand, this is not a FOUC (flash of unstyled

Setup PHPUnit with Zend Test

浪子不回头ぞ 提交于 2019-12-07 03:19:49
问题 I'm trying to start using PHPUnit with Zend Test for my Zend Framework application. I'm able to run the PHPUnit command from command line phpunit --configuration phpunit.xml . I've tried following this tutorial which is based off of Matthew Weier O'Phinney's blog post. I'm getting an error when PHPUnit tries to write the log file. Here's my phpunit.xml <phpunit bootstrap="./Bootstrap.php" colors="true"> <testsuite name="Zend Framework Tests"> <directory>./</directory> </testsuite> <!--

How to add variable at the start of the URL in Zend Framework?

醉酒当歌 提交于 2019-12-07 03:09:42
问题 I am trying here to create url, like: /admin/login /moderator/login both the request would be served by same controller & action made for login, i.e. /account/login/<type> Currently, all I am able to make the following URL: /login/admin /login/moderator My current config file looks like the following: resources.router.routes.login.route = "login/:type" resources.router.routes.login.defaults.controller = "account" resources.router.routes.login.defaults.action = "login" I can't figure out, on

Zend Framework: This row has been marked read-only

主宰稳场 提交于 2019-12-07 02:48:58
问题 This is the first time I've come across this issue. When saving one of my models I get the error message: "This row has been marked read-only". Not sure why I'm getting this error and how to solve it. The stack trace didn't help me. How can I resolve this issue so I can save the record? 回答1: Having a row marked as read only can be the result from any of the following operations: The Zend_Db_Select query joined with another table setIntegrityCheck(false) was set on the select object One or

How to capture a Zend view output instead of actually outputting it

廉价感情. 提交于 2019-12-07 02:44:30
问题 Problem: sometimes in our zend controller we don't want the script to be output directly, but rather want the content of that script. One example: when we need the result html output of a view script be included in another structure like JSON or XML for processing in the client side. I found the result here at stack overflow, but not so quick since it was in a different context. I have been struggling with this for 2 days now. As it turned out it was very simple: // in our controllers' action

Zend Action Controller - refactoring strategy

北城以北 提交于 2019-12-07 02:25:40
问题 I've built a first-run web service on Zend Framework (1.10), and now I'm looking at ways to refactor some of the logic in my Action Controllers so that it will be easier for me and the rest of my team to expand and maintain the service. I can see where there are opportunities for refactoring, but I'm not clear on the best strategies on how. The best documentation and tutorials on controllers only talk about small scale applications, and don't really discuss how to abstract the more repetitive

SWIG generated code fails to run on PHP 5.3.2 undefined symbol: zend_error_noreturn

旧城冷巷雨未停 提交于 2019-12-07 02:10:18
问题 I have a library that I have been using successfully with PHP 5.1.6 with the help of some wrapper code generated by SWIG (v1.3.40). I have just upgraded to PHP 5.3.2 and I am seeing the following error: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/myLib_php.so' - /usr/lib/php/modules/myLib_php.so: undefined symbol: zend_error_noreturn in Unknown on line 0 On investigation it appears that the wrapper code produced by SWIG (myLib_wrap.c) includes calls to the

Zend 2:: getting public folder path or basePath() easily in controller action

别等时光非礼了梦想. 提交于 2019-12-07 01:59:31
问题 In my application, to move a file to a specific directory i need to know public folder path in controller action. I read different this type solution but not getting easy one. I know that in view we can get easily public folder path using $this->basePath(); view helper. I exactly want this in controller action. Anybody can guide me how can i achieve that. Thanks in advance. 回答1: index.php sets the current working dir to you application root (the folder containing composer.json , init

Add a subform to a form with ajax on submit

倖福魔咒の 提交于 2019-12-07 01:53:57
问题 I read this article: http://www.jeremykendall.net/2009/01/19/dynamically-adding-elements-to-zend-form/ That was very interesting and it works fine. I need to do the same but with a SubForm. I mean that when a user presses a button, I call, via ajax, an action that adds, attaches and displays a subform to my existing form. For example: I have a form where a user must fill in the name and surname of his children, so there is a button "Add Child". When the user presses that button a SubForm