zend-framework

Query regarding subdomain redirection in Zend Framework

好久不见. 提交于 2019-12-23 01:57:08
问题 I was looking for an approach using Zend Framework - similar to sites like bit.ly and tinyurl - where I can take a request to a subdomain and store the subdomain in a variable. For instance, a request to localhost/abcdef will return $s = abcdef. I'm not sure how to accomplish this in ZF, where a request to localhost/abcdef will return the init() of the abcdef controller. Thanks for all the help! 回答1: Just use a regex route. $routeitem = new Zend_Controller_Router_Route_Regex('(.*)', array(1 =

Arabic in zend pdf

依然范特西╮ 提交于 2019-12-23 01:52:45
问题 I am new in Zend framework. Now I have a problem with Zend pdf. I am trying to make a pdf document which contains arabic as well as english. But I can't print arabic in zend. Please help me with any tutorials or sample code links. 回答1: This is still an issue in Zend_pdf I would recommend you to use TCPDF here is the link for that http://www.tcpdf.org/ Go through there examples http://www.tcpdf.org/examples.php If you still want to stick with zend pdf may this link be helpful. http://devzone

Magento; private/public filesystem layer

大兔子大兔子 提交于 2019-12-23 01:42:45
问题 I want to split up the magento package in a private and public web directory. E.g. the private directory is reuseable on multiple projects, its just the app. private/ app, downloader, includes, lib, pkginfo, var public/ 404, js, media, report, skin + current root files (index.php etc.) Im setting this up in SVN where just one copy of magento can handle various projects on different stages. I've listed my first goals; Private directory containing all the reuseable package parts Public

How does the method syntax “public function direct(){}” work in PHP?

霸气de小男生 提交于 2019-12-22 22:02:08
问题 I'm learning Zend Framework at the moment and came across the following syntax. class Zend_Controller_Action_Helper_Redirector extends Zend_Controller_Action_Helper_Abstract { /** * Perform a redirect to an action/controller/module with params * * @param string $action * @param string $controller * @param string $module * @param array $params * @return void */ public function gotoSimple($action, $controller = null, $module = null, array $params = array()) { $this->setGotoSimple($action,

Pass a variable from Zend controller to zend form

自作多情 提交于 2019-12-22 19:43:12
问题 I wanted to pass a variable from a controller to the form. How can this be implemented? Can anyone please help me on this issue. Thank you. 回答1: In the controller method of your application. addMultiOptions($options); class OrderController extends Zend_Controller_Action { $options = array( 'foo' => 'Foo2 Option', 'bar' => 'Bar2 Option', 'baz' => 'Baz2 Option', 'bat' => 'Bat2 Option' ); $form = new Application_Form_PlaceNewOrder(); $form->items->addMultiOptions($options); .... } In the form

Make Zend_Rest_Server return JSON instead of XML using ZF

落爺英雄遲暮 提交于 2019-12-22 18:45:19
问题 Can Zend_Rest_Server return Json ? If not, what are the alternatives ( other lib suggestions are ok also) 回答1: Zend_Rest_Server outputs XML, eventhough not clearly specified in the documentation. There are some alternatives: You could leverage the whole MVC architecture given by Zend Framework, thanks to Zend_Rest_Route and Zend_Rest_Controller . You will find a complete example here: http://techchorus.net/create-restful-applications-using-zend-framework Again, the example displays plain

zend locale with url routing

懵懂的女人 提交于 2019-12-22 18:31:49
问题 Is there a simple way of using zend routes and locales in the URL to force the loading of a particular locale? e.g. - http://domain.com/en-US/controller1/action So the language-Region should prefix all URL calls and just set the locale in the bootstrap but let the rest of the MVC routing work as normal. ideally it could detect if no language-Region is in the URL and attempt to autodetect from the browser. e.g. - http://domain.com/ (if no locale is found - defaults to en-US/index) I've seen

zend locale with url routing

我与影子孤独终老i 提交于 2019-12-22 18:30:19
问题 Is there a simple way of using zend routes and locales in the URL to force the loading of a particular locale? e.g. - http://domain.com/en-US/controller1/action So the language-Region should prefix all URL calls and just set the locale in the bootstrap but let the rest of the MVC routing work as normal. ideally it could detect if no language-Region is in the URL and attempt to autodetect from the browser. e.g. - http://domain.com/ (if no locale is found - defaults to en-US/index) I've seen

How to emulate POSTing multiple checkbox form fields myField[] with Zend_Http_Client?

家住魔仙堡 提交于 2019-12-22 18:29:26
问题 I am using Zend_Http_Client to POST a set of data to my server running PHP. However, the server is expecting data in the form myField[] , i.e. I have a set of check boxes and the user can check more than one. My current code is: foreach ($myValues as $value) { $this->client->setParameterPost('myField[]', $value); } However, it seems that Zend_Http_Client is simply overwriting myField[] with the new value each time it goes through the loop. How can I add multiple POST fields of the same name

Magento: When to pass variables to a block and when not to?

谁说我不能喝 提交于 2019-12-22 18:26:10
问题 I have recently found the power of setting variables to a block in the _toHtml() method, using the assign method. My question is, when is it good to do this and when is it not? I am creating a new module and it seems to me it is much nice to just assign all the variables to the block and just reference those variables in the view file rather then setting up something like this <?php $var1 = $this->getVar1(); $var2 = $this->getVar2(); ?> <div id="<?php echo $var1 ?>"><?php echo $var2 ?></div>