zend-framework

Web front end caching best practices for site?

狂风中的少年 提交于 2019-12-31 22:48:29
问题 Summary As I'm looking on stackoverflow and around the net, I find that there is a general lack of good documentation on best practices for caching a high performance site that uses sessions. It would be helpful if we can share some ideas around some basic building blocks particularly around caching. For the purpose of this discussion, I'm avoiding memcache and focusing on the caching of static and pages that are fully generated. So to set up the scenario, imagine a web server (say nginx),

How do you make Zend Framework NOT render a view/layout when sending an AJAX response?

∥☆過路亽.° 提交于 2019-12-31 08:04:07
问题 Zend's documentation isn't really clear on this. The problem is that, by default, Zend automatically renders a view at the end of each controller action. If you're using a layout - and why wouldn't you? - it also renders that. This is fine for normal Web pages, but when you're sending an AJAX response you don't want all that. How do you prevent Zend from auto-rendering on an action-by-action basis? 回答1: Call this code from within whatever Action(s) is/are going to be sending AJAX responses:

How do you make Zend Framework NOT render a view/layout when sending an AJAX response?

一曲冷凌霜 提交于 2019-12-31 08:04:02
问题 Zend's documentation isn't really clear on this. The problem is that, by default, Zend automatically renders a view at the end of each controller action. If you're using a layout - and why wouldn't you? - it also renders that. This is fine for normal Web pages, but when you're sending an AJAX response you don't want all that. How do you prevent Zend from auto-rendering on an action-by-action basis? 回答1: Call this code from within whatever Action(s) is/are going to be sending AJAX responses:

How to Read/Render URLs Like Zend Framework

佐手、 提交于 2019-12-31 07:22:29
问题 I am working on creating my own framework in php. Everything is going as planned except working the framework according to the URL. I cannot understand this: Normal URL loading from www.mydomain.com/folderone/foldertwo/index.php Zend Framework URL loading from the same URL would be www.mydomain.com/folderone(controller)/folder2(action)/variables how can i create that logic? What am i missing? I am really dedicated to create this framework. 回答1: I had the same task as I setup my framework.

I dont understand why my variable is NULL

家住魔仙堡 提交于 2019-12-31 05:09:12
问题 First of all, sorry my english isnt so good. So i have a problem, when i display my variable, he return me NULL and i dont know why :( Label.php class Services_Label extends Services_Abstract { public function getlibelle() { $sRequest = 'SELECT NAME FROM menu WHERE id_application = 2'; $this->executeQueries($sRequest); $aResult = $this->getAllRows(); $this->freeStatement(); return $aResult; } } IndexController.php public function indexAction() { $oMessage = new Services_Label(); $toto =

How to call controller function in view in Zend Framework?

你离开我真会死。 提交于 2019-12-31 04:32:06
问题 In Zend Framework, I have one controller class TestController extends Zend_Controller_Action { public function indexAction() { } public function getResultByID( $id ) { return $id; } } How can I call the function getResultByID in index.phtml ? 回答1: First: public function indexAction() { $this->view->controller = $this } In your view script: <html><title><?php echo $this->controller->getResultByID($this->id); ?></title></html> 回答2: By using Action View Helper : http://framework.zend.com/manual

How to change the default action of the index controller zend

早过忘川 提交于 2019-12-31 03:56:04
问题 I have just created a new Zend project. I want to use the setDefaultAction to change the default action of the Index controller to any other action of the Index controller. I know that I need to code something like : $front = Zend_Controller_Front::getInstance(); $front->setDefaultAction("about"); but in what function I need to code this? Do I need to do something else? 回答1: You could do this in your config ; application.ini resources.frontController.defaultAction = "about" Mind you, this

How do you work with a relational database in Zend Framework?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-31 03:51:06
问题 I'm using the zend framework to write an app and I'm having lots of problems getting my relational database models to work. I've read the quickstart and the docs several times and I'm still not sure how to do this. I post a picture of the relationships between the different tables involved to avoid having to explain everything since English is not my first language and I tend not to make myself clear when I try to explain...well complex things. The tables press_releases, social_networking,

Zend_Config_Xml strange behaviour

随声附和 提交于 2019-12-31 03:16:06
问题 I have a strange problem with Zend_Config_Xml. Here is an example. With this xml file https://gist.github.com/883465 this code: $config = new Zend_Config_Xml('config.xml'); var_dump($config->get('elements')->get('element')->toArray()); gives: array(2) { [0]=> array(2) { ["a"]=> array(1) { ["attr"]=> string(2) "at" } ["e"]=> array(3) { [0]=> array(1) { ["attr"]=> string(2) "at" } [1]=> array(1) { ["attr"]=> string(2) "at" } [2]=> array(1) { ["attr"]=> string(2) "at" } } } [1]=> array(2) { ["a"

Primary key column(s) (id) are not columns in this table ()

会有一股神秘感。 提交于 2019-12-31 01:49:09
问题 I am following the: http://framework.zend.com/manual/en/learning.quickstart.create-model.html. Keep hitting wall after wall of issues. My current one is the following error: An error occurred Application error Exception information: Message: Primary key column(s) (id) are not columns in this table () Stack trace: #0 C:\wamp\www\zendtest\quickstart\library\Zend\Db\Table\Abstract.php(982): Zend_Db_Table_Abstract->_setupPrimaryKey() #1 C:\wamp\www\zendtest\quickstart\library\Zend\Db\Table\Select