indexing - Adding content to a Lucene index in Zend Framework

I'm developing new modules for an intranet based on Precurio, an intranet PHP + MySQL application which used to have a free version.This intranet uses Zend Framework 2.0, and uses Lucene to provide search results. Everytime I add a new module to the intranet I add the functionality to index the contents of the module that the users insert. The problem is, the search works ok, but ONLY if I rebuild all the indexes from scratch. Whenever I add new contents to the module, they don't come up in the search results (the contents that existed previous...Read more

viewrendering - Zend addScriptPath in postDispatch?

is it a good idea to add a script path in postDispatch of a controller? Or is the init() or preDispatch() function a better place for it?public function postDispatch() { $this->view->addScriptPath( path/to/scripts );}In fact adding a script path in postDispatch does not work correctly.So where I should put it - init() or preDispatch()?...Read more

zend framework - nginx php5-fpm failed (2: No such file or directory)

QUESTION: What am I missing or doing wrong?I'm trying to migrate fully functional Zend Framework application from Apache2 with mod_php5 to nginx with php5-fpm. I get this kind of errors:2012/06/27 12:08:04 [error] 1986#0: *1 open() "/var/www/public/sales/live-trials-json" failed (2: No such file or directory), client: *.*.*.*, server:, request: "POST /sales/live-trials-json HTTP/1.1", host: "", referrer: ""Here are my configuration files:a) /etc/nginx/sites-enabled/wwwse...Read more

Zend overwrite default view object

How can i overwrite the default view object in zend framework so i could have the custom one. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {function _initViewHelpers() { $this->bootstrap('view'); $view = $this->getResource('view'); $view->doctype('HTML4_STRICT'); $view->setHelperPath(APPLICATION_PATH . '/helpers', ''); $view->headMeta()->appendHttpEquiv('Content-type', 'text/html;charset=utf-8') ->appendName('description', 'Zend Framework'); $view->headTitle(...Read more

Adding Zend View Helper to all views in application (in bootstrap)

I am using Zend Framework 1.6 hence I'm not utilizing Zend_Application. I have a simple, normal View Helper (extending Zend_View_Helper_Abstract). It works perfectly fine as long as I add it to the view in my action controller. But I want to be able to use it in every view in every module. I figured it should be easy to just get the global view in my bootstrap file and do this:$view->addHelperPath(PATH_VIEW_HELPERS, 'RT_View_Helper_');But I can't seem to be able to get the $view object in my bootstrap file. I also tried $viewRenderer = Zend_...Read more

Zend Framework plugins and helpers - more info

I'm trying to get my head around these issues and have been reading Zend Framework in Action (Allen), and the online documentation. It seems to me that:Action Helpers provide on-demand functionality to the controller; andController Plugins provide runtime functionality to all controllers.Is that right?Secondly, I see that Controller Plugins and Action Helpers can have init(), preDispatch() and postDispatch() methods. In what priority do these execute, relative to those in the Action Controller itself, and to those in other plugins and Helpers...Read more

zend framework - preDispatch() is not called in Controller Plugin

class My_Plugin extends Zend_Controller_Plugin_Abstract{ public function init() { print 'this is working just fine'; } public function preDispatch( Zend_Controller_Request_Abstract $request ) { Zend_Debug::dump($request); print 'why is it not working'; exit; die(':('); // not dieing either }}The plugin is registered in /configs/application.ini file. ZF does see it, because init() function works perfectly fine. But nothing I put into preDispatch seems to work.P.S. the only purpose of ...Read more

view helper in zend framework 2

the thing is these this lines:$loginUrl = $this->view->url(array('controller'=>'auth', 'action'=>'index'));$registerUrl = $this->view->url(array('controller'=>'register', 'action'=>'index'));based on rob allens' Zend_Auth login/logout tutorial (win7/apache),are placed in a view helper, and this one:echo $this->url(array('controller'=>'index','action'=>'add'));is placed in the index view script.The generated links Do work fine in LOCAL, but in REMOTE only the 3rd line works.ANY IDEAS? Where should i look for this? wich wa...Read more

Add path to zend view in plugin

I am trying to add a new path to my view scripts in a preDispatch plugin.My ultimate goal is to run several sites from the same Zend Framework application each with their own layout and view scripts. However I wish to use the default layout/views where a site does not have its own view/layout.I have got the layout to work correctly but I cannot get the view scripts to load.My views folder layout is as follows/application /modules /views /scripts /index index.phtml -> the default index c...Read more

zend framework - How to retain original view after action renders different layout element

I have an action/view script that displays a table of rows, and each row is clickable: I want this action to update a particular div with more details of the row. However, when i do so, the original table is lost ( view is cleared) How can i get an action to render a particular script, but not effect the default layout container? ( layout->content() in this case)Note: I can use _forward() or similar, but I was wondering if there is a more elegant solution.My controller detail action looks like thispublic function detailAction(){ // action bo...Read more

zend framework - How to switch translation view render array?

In a cron controller I want to select records for sending mail and render a pdf from pdf.html view to send as attachment. In the pdf.phtml I have a translation based on translation files. Looping through the array translation should change:for($i=0;$i<count($getData);$i++)i=0 -> tranlate pdf.phtml to Englishi=1 -> translate pdf.phtml to GermanI have tried to set the translation every time in the loopfor($i=0;$i<count($getData);$i++) {select translation file $registry->set('Zend_Translate', $objTranslate);render pdf.but only the first t...Read more

fpdf - Generate PDF files with Zend

Could you help me please to solve my problem. I have to use zend Framework to generate Pdf files. i choose to use FPDF library to do it. When i try to generate Pdf, i get the message below :%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream x???Mn۰ ???,:&? ?s ?h?? ?e6?Ŧlː? ?U??[t Ų-ۚD+IC~|󦉄߮ f ??E! ??Q ?'2? 򂮯ڵ?+(ޅfќ@? ~H? ?Ң?I?H? iyƬ( 4???]Ymⳑ񭨷𰽥-??B3??z?IZ ?La&#1223;?Y?t k%sI???? &#27000;L9?7&#1451;&#1322;???? _?E??$E? ?'?N&a...Read more

zend framework - Zend_Pdf UTF-8 characters?

I have problems outputting UTF-8 characters into pdf file with Zend_Pdf. Here is my code:// Load Zend_Pdf class include 'Zend/Pdf.php';// Create new PDF $pdf = new Zend_Pdf();// Set font $page->setFont(Zend_Pdf_Font::fontWithPath('fonts/times.ttf'), 12); // Draw text $page->drawText('Janko Hraško', 200, 643, 'UTF-8');The font I§m loading supports UTF-8 characters. But I am getting this error" Notice: iconv() [function.iconv]: Detected an illegal character in input string in D:\data\o\Zend\Pdf\Resource\Font\Type0.php on line 241...Read more

Loading models in Zend_Form using Zend Framework

I'm trying to build a form using the Zend_Form component, but the number of elements varies. The information for each Zend_Form element is stored in a database (name, options, validators, filters, etc.).The application I'm working on consists of building surveys which contain a varying number of questions. Each question is associated with different arrays of answers. Ultimately my goal is to build arrays of radio/checkbox buttons, dynamically, server-side.I'm looking for a pretty way to generate my form, but I'm not sure of the best way to load...Read more