zend-framework

Is it possible to show and hide sub form onclick in a Zend form

荒凉一梦 提交于 2019-12-25 05:08:09
问题 Just wondering whether is it possible to show and hide a subform within a zend form on either a radio check event or button onclick event. As I have a form with user field elements and now I want a sub form with password elements which will give the user the ability to optionally change their password. However I only want to show the password elements on request (ie: click a radio button 'Change Password' and the change password elements appear). Is this possible with Zend\Form or would I

zend framework plug-in - predispatch()

你。 提交于 2019-12-25 04:57:46
问题 I wrote a plugin with predispatch() method to check access rights on each controller request . I have made plugin as : class My_Plugin_Checklogin extends Zend_Controller_Plugin_Abstract { public function preDispatch() { if (isset($_SESSION['Zend_Auth_Static'])) { //no login $request = $this->getRequest(); //the request $request->setModuleName('default'); $request->setControllerName('index'); $request->setActionName('index'); //send to default/login/index } } } It's calling predispatch()

How to create a custom router in Zend-Framework?

佐手、 提交于 2019-12-25 04:42:56
问题 I am using a custom Router to enable pages like: mytutorialsite.com/category/:categoryname # added to application.ini resources.router.routes.categorynameOnCategory.route = /category/:categoryname resources.router.routes.categorynameOnCategory.defaults.module = default resources.router.routes.categorynameOnCategory.defaults.controller = category resources.router.routes.categorynameOnCategory.defaults.action = categoryname I also have database table 'categories' in which all categories are

back button takes the user back to protected page after logout -zend framework

这一生的挚爱 提交于 2019-12-25 04:35:22
问题 I have created a pages login , logout to access a control panel scenario goes like this: user logs in and accesss the cpanel page and them logs out Problem : when login is done if user click on browser back button user goes back to login page even though authentication is done and sessions are set, at the same time if user logout , and click back button it will return back to control panel page (if user refresh the page then everything seems to be fine and usr will be redirected to login and

In Zend_Auth, can I get a domain-model User object instead of stdClass?

喜欢而已 提交于 2019-12-25 04:35:10
问题 While working on the login part of an application, I find myself running into an issue: My model is based on Active Record, by extending Zend_Db_Table_Row objects. Whenever I have to deal with a user, I'd want to do this through the User object (being an extended table row). However, Zend_Auth_Adapter_DbTable::getResultRowObject() returns a stdClass and I can not find a way to tell Zend_Auth_Adapter_DbTable to use a specific Db_Table. My three options that I've found so far: Write a custom

Using Poedit to parse Twig templates in a Zend Framework 2 application

你离开我真会死。 提交于 2019-12-25 04:33:40
问题 I've downloaded Poedit, and am attempting to parse my Twig templates. A few tutorials online pointed to https://github.com/umpirsky/Twig-Gettext-Extractor which I later found was referenced in a tutorial here http://aromatix.fr/?p=611 (French) with full instructions. I got the tutorial done, installed umpirsky/twig-gettext-extractor, and when it tries to build the catalog it dies with "cannot execute program". The error popup contains this command: /path/to/twig-gettext-extractor --sort

Why does dojo work when using CDN but not when using $this->dojo->setLocalPath (using Zend Dojo)?

别说谁变了你拦得住时间么 提交于 2019-12-25 04:26:45
问题 I have been using Dojo hosted on Google's CDN. I just downloaded the development version so I can do some debugging. When using dojo stored locally, Firebug reports several syntax errors. They all look like this: SyntaxError: syntax error (no script)(""en-us"")bootstrap.js (line 601) (no script)(""dojo.cldr"", ""number"")bootstrap.js (line 590) (no script)(""dojo.cldr"", ""number"")loader.js (line 634) (no script)(""./number.js"", ""dojo.number"")loader.js (line 76) (no script)(""dojo.number"

How to call a product list in a produt view Magento

南笙酒味 提交于 2019-12-25 03:57:18
问题 I need to display a product list in a product-view page. After a very intensive research i found that a block type="catalog/product_list" doesn't work if its called within a product-view page, so...what is the way to "universally" call a product list that can display in both category and product view pages???. I can't code in view.phtml file, the product list i want to display is called by: {{block type="catalog/product_list" category_id="12" template="catalog/product/featured-products.phtml"

Zend Route incorrect relative path

爱⌒轻易说出口 提交于 2019-12-25 03:37:29
问题 My routes work fine apart from when I am at an action that requires a parameter. For example, these work ok: /news /news/admin /news/admin/add But this doesn't: /news/admin/edit/1 But only routes using the 'default' route render incorrectly (they render as ../../module/controller), all other routes render correctly (/module/conntroller) Any ideas why, or how to fix it? 回答1: It's a common problem. If you are using custom routes in your navigation you must explicitly pass 'default' route to

Zend_Form how to put <a> behind input text?

末鹿安然 提交于 2019-12-25 03:36:19
问题 I try to put some HTML link behind input text and I try to do it's somthing like this: $aElements[$iKey] = $oName = new Zend_Form_Element_Text($aValue['newsletter_question_answer_id']); $oName->addDecorator('HtmlTag', array( 'tag' => 'a', 'href'=>'http://some_url.html', 'placement' => Zend_Form_Decorator_Abstract::APPEND )); and my question is how can I put somthing between <a> and </a> ? Best Regards 回答1: If You don't want to write Your own decorator You have to use callback: $element-