zend-framework

Why DOCUMENT_ROOT is different than realpath('.') on remote server

谁说胖子不能爱 提交于 2019-12-08 02:41:10
问题 with echo realpath('.').'<br>'; echo dirname(__FILE__).'<br>'; echo realpath(dirname(__FILE__)).'<br>'; echo $_SERVER[PHP_SELF].'<br>'; echo getcwd(); I get always /services2/webpages/util/i/g/gg8375620.provider.com.br/mydomain.com/public but in phpinfo DOCUMENT_ROOT is /services/webpages/l/i/mydomain.com/public because of that I'm having hard times with .htaccess in conjunction with Zend Framework. On my local I'm able to make it work. But on the provider host I could not grasp the magic yet

How to get matched route name in View - Zend Expressive

大憨熊 提交于 2019-12-08 02:16:59
问题 I know that I can generate URL passing the route name <?php echo $this->url('route-name') #in view file ?> But can I get information in opposite direction? From current URL/URI, I need to get route name. Real case is: I have layout.phtml where is the top menu (html). Current link in the menu need to be marked with css class. So, example what I need is: <?php // in layout.phtml file $index_css = $this->getRouteName() == 'home-page' ? 'active' : 'none'; $about_css = $this->getRouteName() ==

How write JavaScript with Zend Framework and netbeans?

╄→尐↘猪︶ㄣ 提交于 2019-12-08 01:44:56
问题 I am writing JavaScript like that: <?php $this->headScript()->captureStart();?> $(function(){ // some javascript magic }); <?php $this->headScript()->captureEnd(); ?> But problem is that it is not highlighted and there is no autocomplete... I have tried write like this: <?php $this->headScript()->captureStart();?> //<script> $(function(){ // some javascript magic }); <?php $this->headScript()->captureEnd(); ?> Now it is highlighted but netbeans is not happy about not closed <script> tag and

Zend Framework calling another Controller Action

我的未来我决定 提交于 2019-12-08 01:38:28
问题 Hi i have issue here of calling another controller action to send an mail, here is my code: user.php public function followAction() { $follow_id = $this->_getParam('id'); $response = "<a href='javascript: void(0)' class='i-wrap ig-wrap-user_social i-follow_small-user_social-wrap'><i class='i i-follow_small-user_social ig-user_social'></i>Stop Following</a>"; notifyEmail() ------> need to call Notity Controller with notifyEmail() Action along with params $this->_helper->json($response); ---->

Query builder using Zend Framework

拜拜、爱过 提交于 2019-12-08 01:20:15
问题 I am just beginning my journey into PHP Zend Framework World. The aim of my application is to develop query builder using Zend. This application will be used by many users in a network at same time. When a user performing search based on some conditions provided by the application, the system will fetch the relevant search results from the large database (More than 50 Million Records or even more). Note: One user can perform multiple search requests at a time. Each request creates a unique

Add digital signature appearance programmatically?

廉价感情. 提交于 2019-12-08 00:53:17
问题 I am signing my PDF files programmatically and I would like to add the signature appearance to the PDF : what objects would I need to achieve this ? I know I have to Annotations , BBox and XObject but I don't really know in which order and if I need other things. It is really hard to debug this kind of stuff to find the right configuration so any help would be appreciated ! This is the kind of appearance I want to have : I am using Zend_Pdf to handle my files. 来源: https://stackoverflow.com

how to cleanup / free database query memory in zend?

谁都会走 提交于 2019-12-08 00:35:03
问题 After executing this simple code (for MySQL database) I get 1kB of memory less for each loop iteration, so after 1000'th iteration I have about 1MB memory used. Now, if I have to loop in a long running script (about 1 000 000 iterations) I will be out of memory quickly $_db = Zend_Db_Table::getDefaultAdapter(); $start_memory = memory_get_usage(); for ($i=0; $i<1000; $i++) { $update_query = "UPDATE table SET field='value'"; $_db->query($update_query); } echo 'memory used: '.(memory_get_usage()

Pagination in Zend Framework

别说谁变了你拦得住时间么 提交于 2019-12-08 00:27:33
问题 I am a noob in Zend and I would appreciate if you could help me to figure out how to use pagination in my case. this is my view and this is my controller I am using APIs to access my models. I researched and read a lot about pagination in Zend but I had/have trouble implementing it. Thank you for your willingness to help me out. 回答1: in your controller in line 36 write : (assuming $resultq is a valid zend_paginator param) $paginator = Zend_Paginator::factory($resultq); $paginator-

Passing an array as a value to Zend_Filter

て烟熏妆下的殇ゞ 提交于 2019-12-07 23:44:53
问题 I'm trying to implode an array by using the Zend_Filter_Interface. Here's my simplified test case. class My_Filter_Implode implements Zend_Filter_Interface { public function filter($value) { return implode(',', $value); } } The input will be an array. $rawInput = array('items' => array('a', 'b', 'c')); $validators = array( 'items' => array() ) $filters = array( 'items' => 'Implode' ); $filterInput = new Zend_Filter_Input($filters, $validators, $rawInput, $options); I would like the filter to

Zend Form Decorators Error in Table

大憨熊 提交于 2019-12-07 23:43:27
问题 I am using the next decorators for my input. I want to make this as table. $this->setDecorators(array('ViewHelper','Errors', array(array('data'=>'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row'=>'HtmlTag'),array('tag'=>'tr')) )); But after form validation Errors showing not in td. How can I do this? I want to make the next makeup: <table> <tr> <td>Lable</td> <td>Input</td> <td>Error</td> </tr> </table> 回答1: $this->setDecorators( array( 'ViewHelper',