zend-framework

Getting an element from PHP DOM and changing its value

房东的猫 提交于 2019-12-24 15:36:32
问题 I'm using PHP/Zend to load html into a DOM, and then I get a specific div id that I want to modify. $dom = new Zend_Dom_Query($html); $element = $dom->query('div[id="someid"]'); How do I modify the text/content/html displayed inside that $element div, and then save the changes to the $dom or $html so I can print the modified html. Any idea how to do this? 回答1: Zend_Dom_Query is tailored just for querying a dom, so it doesn't provide an interface in and of itself to alter the dom and save it,

Autoload classes with Zend based naming convention or no convention at all with Symfony 2

喜欢而已 提交于 2019-12-24 15:36:32
问题 How can I use the Symfony2 ClassLoader to autoload classes that dont follow PEAR naming conventions and don't use namespaces? It seems from the symfony2 docs that this isn't possible. How does one include API helper libraries or other files that don't follow these types of conventions (i.e. they instead follow Zend conventions or no naming conventions at all)? 回答1: You should register autoloading functions for those classes using spl_autoload_register(). This will let you have several

Unable to access module forms in module controller

折月煮酒 提交于 2019-12-24 14:58:36
问题 I have a test module. In test module I have a Form in forms folder. myproject/application/modules/test/forms/TestForm.php class Test_Form_TestForm extends Zend_Form { //form elements } myproject/application/modules/test/controllers/TestController.php class Test_TestController extends Zend_Controller_Action { public function indexAction() { $this->view->form = new Test_Form_TestForm(); // this is generating error } } // end class Form initialization in controller is generating following error:

backup a google doc spreadsheet with php & zend

ぃ、小莉子 提交于 2019-12-24 13:15:02
问题 Hi Trying to use php to backup a google doc spreadsheet into another (without writing row by row) or to download it like an excel document Can someone help me? 回答1: You'll likely find the answers in the Google Docs API. The entry for copying Google Documents shows this sample: send an HTTP POST to the main feed. In the <entry> , set the <id> to the self link of the source entry (the document to be copied). Use PHP to send an HTTP POST request when you have that ID data. POST /feeds/default

How to use jQuery UI Tabs inside one jQuery UI Tab?

冷暖自知 提交于 2019-12-24 12:39:26
问题 i am using jQuery UI Tabs (Content via AJAX) what i need to do is that in one of my Tab i want other simple jQuery UI Tabs means (Content NOT via AJAX) but its not working.. pardon if i am doing something wrong :( <div id="tabs"> //these tabs are working fine <ul> <li><a href="<?php echo $this->url(array(), 'abc') ?>">A</a></li> <li><a href="<?php echo $this->url(array(), 'asd') ?>">B</a></li> <li><a href="<?php echo $this->url(array(), 'xyz') ?>">C</a></li> </ul> I have add the below code in

Zend session initiation

。_饼干妹妹 提交于 2019-12-24 12:22:01
问题 I have the following code in my zend application bootstrap file protected function _initSessionId() { $this->bootstrap( 'session' ); $opts = $this->getOptions(); $cache = $this->bootstrap( 'cachemanager' ) ->getResource( 'cachemanager' ) ->getCache( 'memcached' ); Zend_Db_Table_Abstract::setDefaultMetadataCache( $cache ); Zend_Registry::set( 'cache', $cache ); $defaultNamespace = new Zend_Session_Namespace(); if ( !isset( $defaultNamespace->initialized ) ) { Zend_Session::regenerateId();

View overloading in Zend Framework

时光总嘲笑我的痴心妄想 提交于 2019-12-24 11:52:52
问题 Let's say I have 2 controllers, content and news: class ContentController extends Zend_Controller_Action { } and class NewsController extends ContentController { } If there are no views found for the news controller, I want Zend to use the scripts path of its parent controller. How can I achieve this without having to route to its parent controller? 回答1: You will have to add the scriptPath manually: class ContentController extends Zend_Controller_Action { public function init() { $this->view-

View overloading in Zend Framework

余生长醉 提交于 2019-12-24 11:48:05
问题 Let's say I have 2 controllers, content and news: class ContentController extends Zend_Controller_Action { } and class NewsController extends ContentController { } If there are no views found for the news controller, I want Zend to use the scripts path of its parent controller. How can I achieve this without having to route to its parent controller? 回答1: You will have to add the scriptPath manually: class ContentController extends Zend_Controller_Action { public function init() { $this->view-

Share zend module controllers for use in another module

☆樱花仙子☆ 提交于 2019-12-24 11:37:11
问题 Let's say I have a User_RegistrationController from with I want to extend in another module like so: class Clinic_RegisterController extends User_RegisterController but I've PHP error for that: ( ! ) Fatal error: Class 'User_RegisterController' not found /application/modules/clinic/controllers/RegisterController.php on line 4 Is there any way to extend a controller from another module? 回答1: You could pull your base controller into into a separate library class: class App_Controller_Action

Zend Framework without the zend tool

╄→гoц情女王★ 提交于 2019-12-24 11:36:34
问题 I just started learning the zend framework and what im wondering is , is it possible to create controllers and actions without ever touching the zend tool? I see the zend tool a great tool when creating new projects or a new controller but for creating actions its just extra work. Is it also possible to output an actions variables into the associated controllers view rather than its own view? thanks 回答1: You don't really need Zend Tool if you don't want. I find it helpful for creating the