zend-framework

Autoloading classes when not in same directory as zend library

人盡茶涼 提交于 2019-12-24 00:27:25
问题 I've decided that rather than have a copy of the Zend Framework in each application's directory, I'd like to keep it on one location on the server, with the one copy used by all my websites. However, I'd like my app's custom classes to still be within the application folder. So a folder structure a bit like this: webroot |...library | |......Zend | |...app1 | |.....Library | |.......App1 | |...app2 |.....Library |.......App2 How can I get Zend Loader to automatically find the classes in App1

Zend_Controller_Router_Route

我们两清 提交于 2019-12-23 23:51:52
问题 I'm trying to make a Router that can respond to this structure: module/controller/action/id and module/controller/action/page The only difference is is 'id' or 'page'. I'm using this code: $routeAdmin = new Zend_Controller_Router_Route( 'administrador/:controller/:action/:id/:pg', array( 'module' => 'administrador', 'controller' => 'index', 'action' => 'index', 'id' => 0, 'pg' => 1 ), array( 'id' => '\d+', 'pg' => '\d+' ) ); $router->addRoute('administrador', $routeAdmin); The problem is that

Zend_Form Array Based Element Setup and Retreival

人盡茶涼 提交于 2019-12-23 22:07:37
问题 I have two entities involved in this issue. A user can have an event that has multiple pieces of equipment tied to it. I need a form that the user can enter hours and roi for that piece of equipment at that particular event. Equipment in this case is actually an entity in the middle of two other entities (equipment and event) to create a many to many with extra parameters. So equipment has the fields 'hours' and 'roi'. I would like to have my form dynamically added a field for hours and roi

How can I generate XML application configuration using Zend_Tool?

北慕城南 提交于 2019-12-23 21:56:27
问题 When creating a new project using zf create project myproject it will create a default project layout with an application.ini in the configs folder. Where can I change these default settings so that it generates (and uses) an XML file (application.xml)? I've looked at the documentation for Zend_Tool (http://framework.zend.com/manual/en/zend.tool.html), but there seems to be no information on how to do this. And suppose you'd like to use a different default folder layout (ie. use htdocs

ZF 2: tutorial application, 'Config being merged must be an array […]'

 ̄綄美尐妖づ 提交于 2019-12-23 21:28:00
问题 My Enviroment (Zend Server): PHP Version 5.4.11 Zend Server Version: 6.0.1 Zend Framework: 1.12.3, 2.1.4 Zend Server Gateway: 0.9.0.201301302347 Build: 69400 So I tried to write my first application in ZF2 form official tutorial. ZF version in skeleton application: 2.2 This is link to my project, if someone wants to look at it closer. config/module.config.php <?php return array( 'controllers' => array( 'invokables' => array( 'Album\Controller\Album' => 'Album\Controller\AlbumController', ), )

zf2 Form Validator DateTime dateInvalidDate

我只是一个虾纸丫 提交于 2019-12-23 21:20:03
问题 Trying to use a DateTime Form element in ZF2 and cannot valid the form. $inputFilter->add(array( 'name' => 'event_datetime', 'required' => true, 'filters' => array( array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 0, 'max' => 20, ), ), ), )); Using this on the .phtml file. <?php $formElement = $form->get('event_datetime');?> <dt><?php echo $this->formLabel($formElement);?></dt> <dd><?php echo $this-

https request on some pages but not on all pages zend framework

牧云@^-^@ 提交于 2019-12-23 20:30:58
问题 I need to put https on some of the URL but not on all the URL. I am using zend URl view helper for all the links. I have a *.example.com SSL certificate for whole site. Now I open site with https://www.example.co, then all the link on home page or other pages contains https in URL. How can I make some specific request on the https url and other page should be opened normal. I also need to pt some redirection so that if somebody open the specific pages in normal URL then they redirected on

Getting started with cron jobs and PHP (Zend Framework)

偶尔善良 提交于 2019-12-23 20:07:32
问题 I am totally new to the subject of cron jobs so I have no idea where to start learning about them; when, why, or how to use them with my Zend Framework application, or PHP in general. Can anyone explain the process, with an example, or recommend some good resources to get started? 回答1: Cron jobs is a mechanism to automate tasks in Linux operating system. And has pretty little to do witn Zend Framework. The framework can help you develop an advanced cron task in php though. But then you will

How to handle Zend_Exception's in preDispatch or init of an action when using a base controller?

六眼飞鱼酱① 提交于 2019-12-23 19:38:54
问题 As mentioned in the Zend Framework manual, I created a base controller. Subclassing the Action Controller By design, Zend_Controller_Action must be subclassed in order to create an action controller. At the minimum, you will need to define action methods that the controller may call. Besides creating useful functionality for your web applications, you may also find that you're repeating much of the same setup or utility methods in your various controllers; if so, creating a common base

Zend Navigation Custom Rendering

吃可爱长大的小学妹 提交于 2019-12-23 18:50:37
问题 I'm trying to create a custom navigation for zend navigation but i have two questions: How do i pass variables to custom partial phtml, or if it's possible? How do i set a class trough the whole active menu tree? This is my code so far: in the controller: $config = new Zend_Config($menu); $nav = new Zend_Navigation(); $nav->addPages($config); $this->view->nav = $nav; in the view: <?php echo $this->navigation($this->nav)->menu()->setPartial('menu.phtml')->render(); ?> and my partial: <?php