zend-framework

Zend Framework - JQuery - Date Picker - Images not displayed

自闭症网瘾萝莉.ら 提交于 2019-12-12 01:54:22
问题 I am developing a web application with Zend Framework, and I am using JQuery for my forms. I have a problem with the DatePicker in a form. When I click on the text input, the DatePicker appears, but without the themes images... In my bootstrap: $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper'); $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer(); $viewRenderer->setView($view); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); in my

jQuery 1.5 - JSON error invalid label

不想你离开。 提交于 2019-12-12 01:53:35
问题 I am getting the invalid label error now I have upgraded my jQuery. I read that the new 1.5 version is now more strict on the JSON encoding. Although I use Zend_Json::encode(array("content"=>$result)); to encode the HTML so would of thought this would . I read in the manual that it has been updated although cant get this to work without parse errors. jQuery JSON Manual Error: invalid label Source File: http://domain.local/register/# Line: 0, Column: 1 Source Code: {"content":"<div id=\

How to load select option from database in zf2

时光毁灭记忆、已成空白 提交于 2019-12-12 01:44:49
问题 I Have been following zf2 guide for blog I have created everything Controller, Factory, Form, Mapper, Model, Service, view etc In my form I have a select element $this->add(array( 'type' => 'select', 'name' => 'roleId', 'attributes' => array( 'id' => 'roleId', 'options' => array( '1' => 'Admin', '2' => 'Manager', ), ), 'options' => array( 'label' => 'Role', ), )); Now in this form I want to load the option for the role from the database. I tried loading the option by creating a simple

Zend Framework join

时光毁灭记忆、已成空白 提交于 2019-12-12 01:38:32
问题 I've been struggle for hours with the follow join issue in Zend Framework. My table(s) Table (websites) id user_id website url ... Table (users) id username salt password ... Table (reviews) id website_id (id of website) user_id (id from the user/owner of the website) reviewer_id (id from the user who has reviewed the website) review ... What do I want to get.. To make a array with join of the review and user data is no problem, but I want also add the website compare to the review. I made

Zend form populate function not working for select type of element

允我心安 提交于 2019-12-12 01:38:12
问题 I am setting up a zend form as: class Application_Form_Ticket_Search extends Zend_Form { private $_itemList; public function setItemList($itemList) { $this->_itemList[0] = 'Select Item'; // Default selected value foreach($itemList AS $key => $value) { $this->_itemList[$value['REFERENCE']] = $value['DESCRIPTION']; } } // Initializes search form public function init() { // Settings POST type request $this->setName('search')->setMethod('GET'); $this->addElement('select', 'item', array( 'label' =

ZF - How to cache parts of the layout

杀马特。学长 韩版系。学妹 提交于 2019-12-12 01:33:54
问题 I use Stacic Page Cache (with cache action helper) to cache most of the pages of my App. This is extremly fast, but not always suitable. How do you cache pages with dynamic data? Eg. layout contains info specific to user. One solution I considered is to load additional data via Ajax. But in my case it would be better to cache parts of the pages (eg. list of entries or sidebar partial). Is there any ZF recommended way to do it? Eg. cache the view only, not the layout or vice versa. Cache

acl for edit post page?

我的梦境 提交于 2019-12-12 01:32:31
问题 i wonder if i shld use an ACL rule (PHP/ Zend_Acl in my case) for something as small as a edit post page? i guess the criteria to allow users to edit a post will be owner of post editors/moderators/admin the question will be if yes (to use acl), how can i define it (i am using Zend_Acl but if u give me some code example, i might be able to translate it). acl's i think will generally be defined at application start/bootstrap. in this case, its partially dynamic as in i must chk against the

ZF2 Routing by Hostname works with other modules

∥☆過路亽.° 提交于 2019-12-12 01:28:53
问题 I added a reseller subdomain on my myhost.com ( reseller.myhost.com ) and I use it for routing to my Reseller module. Read this question I posted before here: click here My Reseller route config looks this: 'router' => array( 'routes' => array( 'Reseller' => array( 'type' => 'Hostname', 'options' => array( 'route' => 'reseller.myhost.com', 'constraints' => array( ), 'defaults' => array( 'controller' => 'Reseller\Controller\Reseller', 'action' => 'index' ) ), 'may_terminate' => true, 'child

Zend Form: Dependant field validation

笑着哭i 提交于 2019-12-12 01:03:36
问题 I have a form with two select boxes: country and city, city depending on the selected country. Note that the city field is populated dynamically when a country is selected using Ajax. So far I extended Zend_Form_Element_Select overriding isValid() for the city select box, and I'll use the $context argument to get the selected country and check if the city is valid (for that country). I want to skip city validation if the country validation fails. For example someone can inject a bad value

Setting up for Zend Framework htaccess file

三世轮回 提交于 2019-12-12 01:02:13
问题 That is my project dir: /webroot /myproject index.php /application /config /library /public /css /img /js index.php .htaccess That is my code in /myproject/index.php <?php include 'public/index.php'; Code in .htaccess 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] RewriteRule !\.(js|ico|gif|jpg|png|css|swf