Search Results

Search found 1568 results on 63 pages for 'zend sklave'.

Page 22/63 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • associated array elements in zend form

    - by ToonMariner
    Hi, Been trying to find a solution for this for a while with not much luck... Need to render a form with an array of checkboxes each having an associated textbox. given an array of array('Dave'=23,'Pete'=12,'Si'=43); the resulting mark-up should yield: <div> <label><input type="checkbox" name="user_id[]" id="user_id-1" value="23" />Dave</label> <label for="job-1">Job:</label><input type="text" name="job[]" id="job-1" /> </div> <div> <label><input type="checkbox" name="user_id[]" id="user_id-2" value="12" />Pete</label> <label for="job-2">Job:</label><input type="text" name="job[]" id="job-2" /> </div> <div> <label><input type="checkbox" name="user_id[]" id="user_id-3" value="43" />Si</label> <label for="job-3">Job:</label><input type="text" name="job[]" id="job-3" /> </div> Complete zend noob so any help appreciuated (including decorators etc.) Thanks peeps

    Read the article

  • Zend Framework Application: module dependencies

    - by takeshin
    How do you handle dependencies between modules in Zend Framework to create reusable, drop-in modules? E.g. I have Newsletter module, which allows users to subscribe, providing e-mail address. Next, I plan to add Blog module, which allows to subscribe to posts by e-mail (it obviously duplicates some functionality of the newsletter, but the e-mails addresses are stored in User model). Next one is the Forum module, with the same subscribe to post functionality. But I want to have ability to use these modules independent to each one, i.e. application with newsletter alone, newsletter with blog, comibnation two or three modules at once. This is pretty common, e.g. the same story with search feature. I want to have search module, with options to search in all data, blog data or forum data if available. Is there any design pattern for this? Do I have to add some moduleExists($moduleMame), or provide some interface or abstract classes, some base controller pattern, similar for each module?

    Read the article

  • Zend Framework - Deny access to folders other than public folder

    - by Vincent
    All, I have the following Zend application structure: helloworld - application - configs - controllers - models - layouts - include - library - public - .htaccess - index.php - design - .htaccess The .htaccess in the root folder has the following contents: ##################################################### # CONFIGURE media caching # Header unset ETag FileETag None Header unset Last-Modified Header set Expires "Fri, 21 Dec 2012 00:00:00 GMT" Header set Cache-Control "max-age=7200, must-revalidate" SetOutputFilter DEFLATE # ##################################################### ErrorDocument 404 /custom404.php RedirectMatch permanent ^/$ /public/ The .htaccess in the public folder has the following: Options -MultiViews ErrorDocument 404 /custom404.php RewriteEngine on # The leading %{DOCUMENT_ROOT} is necessary when used in VirtualHost context RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -s [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -l [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] My vhost configuration is as under: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "C:\\xampp\\htdocs\\xampp\\helloworld\\" ServerName helloworld ServerAlias helloworld <Directory "C:\\xampp\\htdocs\\xampp\\helloworld\\"> Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory> </VirtualHost> Currently, if the user visits, http://localhost, my .htaccess files above make sure, the request is routed to http://localhost/public automatically. If the user visits any other folder apart from public folder from the address bar, he gets a directory listing of that folder. How can I make sure to deny the user access to every other folder except the public folder? I want the user to be redirected to the public folder if he visits any other folder. However, if the underlying code requests something from other folders, (ex: ) it should still work.. Thanks

    Read the article

  • Zend, slow load, "waiting for response" for 20-80 seconds on local site

    - by Tony C.
    So I have several sites running under the same zend setup. All of the sites run pretty normally except one. Upon loading or reloading this one site, reguardless of which page your on (excluding the 404 page explanation later...) you get a serious pause before any content begins to download. Using firebugs net panel you can see that the first request which is www.(siteaddress).com.local you see a "waiting for response" bar (purple) that is going for anywhere from 20 to sometimes 80+ seconds and this isn't on a dev site, this is on a local site under localhost. What I've managed to figure out so far is that all the pages do this except my 404 page. The reason the 404 page doesn't succumb to this is because it uses a seperate controller (the error controller) and therefore bypasses much of the controller and functions the other parts of the site use. Using exit statements I've manged to figure out that the problem happens somewhere between my post dispatch and my main (top most) controllers Init function. If i exit in the main controllers init the page loads (then exits instantly, no wait). If i do the same in the pre or post dispatch the page waits the 20-80 seconds then exits. Is there a diagram or explanation somewhere or a way for me to find out what events fire inbetween the post dispatch and the main controllers init function? Or does anyone have any clue what might cause this? Any help would be greatly appreciated...

    Read the article

  • Array to Array pushing in Zend Session object

    - by kate-koopy
    Hello! I have some example of pushing array to array in session object: class someClass extends someOtherOne { ...////// some other code here that starts session and creates namespace public function __add2Session($a,$b) { $namespc = $this -> __getnewNameSpace(); //returns a Zend Session Namesapce (object) if (!isset($namespc -> {$a})) { $namespc -> {$a} = array(); } array_push($namespc -> {$a}, $b); } } ...///////////// $item=array(1=>"one",2=>"two",3=>"three",4=>"four",5=>"five",6=>"six",7=>"seven"); $k = new someClass(); $cart = new Zend_Session_Namespace('Cart'); $k -> __add2Session("items",$item); The result is when I reload the page several times - the value of $cart -> items in the session gets overwritten and not populated. Can somebody explain why it occurs and how do I fix this? I want to have $cart -> items to be an "array in array" like: $cart -> items = array(array(1=>"one",2=>"two"), array(1=>"two",2=>"three"));

    Read the article

  • Problem with using Jquery.ajax over .load on Zend

    - by Matthew
    Right now, what i'm trying to do is to replace a label on the front page with a block of html. Right now, the page basically has: <label id="replace"></label> the js currently has: $(document).ready(function(){ $("#replace").load('/test'); }); the Zend class function has: public function indexAction(){ $this->_helper->layout()->disableLayout(); $this->_view->message = "This is from TestController index"; } and finally the index.phtml template simply has: <?php echo $this->message;?> Right now, I want to change the code around so that instead of just replacing that label with the same message, it would do a POST where the function will pull out a parameter, do something (like for instance, go to the database and pull something out with the POST parameter) and then return the message. I've tried editing the js so that it would look like: $.post('/test', {param : "test_param"}, function(data) {$("#replace").html(data);}); or $.ajax({ type: 'POST', url: '/test', data: "{param:test_param}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(data) {$("#replace").html(data);} }); and neither worked. I took a step back and tried to replicate the .load functionality and do: $.ajax({ url: '/test', success: function(data) { $('#replace').html(data); alert('Load was performed.'); } }); and it doesn't work either. Anyone have any tips on how to go about doing this?

    Read the article

  • Multiselect tranfer in zend

    - by niriza
    I want to transfer the selected value of Zend_Form_Element_Multiselect to another multiselect element of zend form. I tried this with JQuery it works but when I try to populate the form I get a problem what should I do in my controller. My code look like this: Form: $form['core'] = new Zend_Form_Element_Multiselect('core'); foreach ($results as $row) { $form['core']-addMultiOption($row['id'],$row['competencies']); } $form['core']-setLabel('Core competencies')-setAttrib('id','select1'); $form['core_competency'] = new Zend_Form_Element_Multiselect('core_competency'); foreach ($results as $row) { $form['core_competency']-addMultiOption($row['id'], ''); } $form['core_competency']-setAttrib('id','select2'); $form['subsidiary'] = new Zend_Form_Element_Multiselect('subsidiary'); foreach($results as $row) { $form['subsidiary']-addMultiOption($row['id'],$row['competencies']); } $form['subsidiary']-setLabel('Subsidiary competencies'); $form['subsidiary_competency'] = new Zend_Form_Element_Multiselect('subsidiary_competency'); $form['subsidiary_competency']-addMultiOption('',''); $form['save'] = new Zend_Form_Element_Submit('competencies'); $form['save']-setLabel('Save')-setValue('competencies') -setAttrib('id','competencies-save'); $this-addElements($form); $this-setMethod('post');

    Read the article

  • Location of DB models in Zend Framework - want them centralized

    - by jeffkolez
    Maybe I've been staring at the problem too long and it's much simpler than I think, but I'm stuck right now. I have three websites that are going to share database models. I've structured my applications so that I have an application directory for each site and a public directory for each site. The DB models live in a directory in the library along with Zend Framework and my third party libraries. I use the Autoloader class and when I try to instantiate one of my DB classes, it fails. The library directory is in my include path, but for whatever reason it refuses to instantiate my classes. It will work if I have my models in my application directory, but that's not the point. They're supposed to be shared classes in a Library. $model = new Model_Login(); $model->hello_world(); This fails when its in the library. The class is just a test: class Model_Login { public function hello_world() { echo "hello world"; } } Everything works until I try to instantiate one of my models. I've even tried renaming the class to something else (Db_Login), but that doesn't work either. Any ideas? Thanks in advance.

    Read the article

  • Zend Framework + Uplodify Flash Uploader Troubles

    - by Richard Knop
    I've been trying to get the Uploadify flash uploader (www.uploadify.com) to work with Zend Framework, with no success so far. I have placed all Uploadify files under /public/flash-uploader directory. In the controller I include all required files and libraries like this: $this->view->headScript()->appendFile('/js/jquery-1.3.2.min.js'); $this->view->headLink()->appendStylesheet('/flash-uploader/css/default.css'); $this->view->headLink()->appendStylesheet('/flash-uploader/css/uploadify.css'); $this->view->headScript()->appendFile('/flash-uploader/scripts/swfobject.js'); $this->view->headScript()->appendFile('/flash-uploader/scripts/jquery.uploadify.v2.1.0.min.js'); And then I activate the plugin like this (#photo is id of the input file field): $(document).ready(function() { $("#photo").uploadify({ 'uploader' : '/flash-uploader/scripts/uploadify.swf', 'script' : 'my-account/flash-upload', 'cancelImg' : '/flash-uploader/cancel.png', 'folder' : 'uploads/tmp', 'queueID' : 'fileQueue', 'auto' : true, 'multi' : true, 'sizeLimit' : 2097152 }); }); As you can see I am targeting the my-account/flash-upload script as a backend processing (my-account is a controller, flash-upload is an action). My form markup looks like this: <form enctype="multipart/form-data" method="post" action="/my-account/upload-public-photo"><ol> <li><label for="photo" class="optional">File Queue<div id="fileQueue"></div></label> <input type="hidden" name="MAX_FILE_SIZE" value="31457280" id="MAX_FILE_SIZE" /> <input type="file" name="photo" id="photo" class="input-file" /></li> <li><div class="button"> <input type="submit" name="upload_public_photo" id="upload_public_photo" value="Save" class="input-submit" /></div></li></ol></form> And yet it's not working. The browse button doesn't even show up as in the demo page, I get only a regular input file field. Any ideas where could the problem be? I've already been staring into the code for hours and I cannot see any mistake anywhere and I'm starting to be exhausted after going through the same 30 lines of code 30 times in a row.

    Read the article

  • How to make a composite Zend Form Element that includes a Dojo Field

    - by Joe
    I used the zendcast video to get me this far. The form is properly displayed. However, I need to change the display order box into a number box of zend dojo type. I cannot figure it out. Even help with examples would be great. <?php class My_View_Helper_CategoryDetailElement extends Zend_View_Helper_FormElement { protected $html = ''; public function CategoryDetailElement($name, $value = null, $attribs = null) { $type = $description = $displayOrder = $time = ''; if($value) { $type = $value->type; $description = $value->description; $displayOrder = $value->displayOrder; $time = $value->time; } $helper = new Zend_View_Helper_FormText(); $helper->setView($this->view); $helper_label = new Zend_View_Helper_FormLabel(); $helper_label->setView($this->view); $helper_select = new Zend_View_Helper_FormSelect(); $helper_select->setView($this->view); $helper_textarea = new Zend_View_Helper_FormTextarea(); $helper_textarea->setView($this->view); $this->html .= $helper_label->formLabel($name . '[type]', 'Type: ', array()); $this->html .= $helper_select->formSelect($name . '[type]', $type, array(), array('individual'=>'individual', 'team'=>'team')); $this->html .= "<br />"; $this->html .= $helper_label->formLabel($name . '[description]', 'Description: ', array()); $this->html .= $helper_textarea->formTextarea($name . '[description]', $description, array()); $this->html .= "<br />"; $this->html .= $helper_label->formLabel($name . '[displayOrder]', 'Display Order: ', array()); $this->html .= $helper->formText($name . '[displayOrder]', $displayOrder, array()); $this->html .= "<br />"; $this->html .= $helper_label->formLabel($name . '[time]', 'Time: ', array()); $this->html .= $helper->formText($name . '[time]', $time, array()); return $this->html; } } ?>

    Read the article

  • zend tool is not working

    - by user362155
    Hi, I've installed ZendStudio 7.2 it creates project normally with no error but when i try to add action(s) in it, it says project profile does not exist. and the error log is as follow: executing zf create action showLatest index-action-included An Error Has Occurred A project profile was not found. Zend Framework Command Line Console Tool v1.10.2 Details for action "Create" and provider "Action" Action zf create action name controller-name[=Index] view-included[=1] module Failed loading ./ZendDebugger.so: (null) PHP Warning: PHP Startup: Unable to load dynamic library './ext/bcmath.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/bz2.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/calendar.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/ctype.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/curl.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/exif.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/fileinfo.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/ftp.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/gd.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/imagick.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/json.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/ldap.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mbstring.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mcrypt.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/memcache.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mhash.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mime_magic.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mssql.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mysql.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mysqli.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/pcntl.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/pgsql.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/posix.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/shmop.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/soap.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sockets.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sqlite.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sysvmsg.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sysvsem.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sysvshm.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/tidy.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/tokenizer.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/wddx.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/xmlreader.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/xmlrpc.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/xsl.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/zip.so' - (null) in Unknown on line 0 please help me to configure latest ZendTool with ZendStudio 7.2 or how can i get rid of this. i am runin ZS 7.2 on my mac os x 10.5.8 thanks.

    Read the article

  • ZendSession giving fatal error when trying to include...

    - by Ronedog
    I'm getting an error when trying to include Session.php for the ZendFramework. Here's how I include it: $ZEND_LIBRARY_PATH = "path_to_zend_library_folder"; set_include_path( get_include_path() . PATH_SEPARATOR . $ZEND_LIBRARY_PATH); include_once '../classes/zend/library/zend/Session.php'; $account_info = new Zend_Session_Namespace('account'); The file gets included ok, but I get this error: Cannot redeclare class Zend_Session How can I get this to work?

    Read the article

  • Which is easier to learn, Zend Framework, CakePHP or CodeIgniter?

    - by Kwame Boame
    I am new to programming but I know HTML, CSS and Jquery. I am a web designer but want to expand my skill to application development with frameworks. Specifically, PHP frameworks. I want to know which of the frameworks mentioned in the question is difficult to master. Also, my friend wants me to learn Ruby on Rails/ Python instead of PHP. What's your best advice for a newbie programmer who is looking to build online software/apps in the near future; say, after 3 months/6 months or a year of study and practice?

    Read the article

  • How can I use Zend Studio for Java development?

    - by Itay Moav
    I have the Zend Studio, which is a PHP editor based on Eclipse. I want to use it now to develop some Java. I think Zend has disabled all the Java centric project/views/perspectives that come with Eclipse (or may be not included the right plugins?) What steps should I take to use it, instead of having two Eclipse instances open at the same time.

    Read the article

  • Access custom error messages for InArray validator when using Zend_Form_Element_Select

    - by Ben Waine
    Hello, I'm using Zend Framework 1.62 (becuase we are deploying the finished product to a Red Hat instance, which doesn't have a hgih enough PHP version to support ZF1.62). When creating a Form using Zend Form, I add a select element, add some multi options. I use the Zend Form as an in-object validation layer, passing an objects values through it and using the isValid method to determine if all the values fall within normal parameters. Zend_Form_Element_Select works exactly as expected, showing invalid if any other value is input other than one of the multi select options I added. The problem comes when I want to display the form at some point, I cant edit the error message created by the pre registered 'InArray' validator added automatically by ZF. I know I can disable this behaviour, but it works great apart from the error messages. I've tryed the following: $this->getElement('country')->getValidator('InArray')->setMessage('The country is not in the approved lists of countries'); // Doesn't work at all. $this->getElement('country')->setErrorMessage('The country is not in the approved lists of countries'); // Causes a conflict elswhere in the application and doesnt allow granular control of error messages. Anyone have any ideas? Ben

    Read the article

  • How can I add a plugin to the registry while using a Zend_Form?

    - by Mallika Iyer
    I have a zend form that I'm initializing as follows: $form = new Form_XYZ(); I have a display group in that form, which I'm calling like this: $form->addDisplayGroup($generalSettingsGroup, 'general', array( 'legend' => 'General', 'disableDefaultDecorators' => true, 'decorators' => array( 'FormElements', 'FieldSet', array('HtmlTag', array('tag' => 'div', 'class' => 'general') ) ) ) ); I get this error : ArrayObject Object ( [exception] => Zend_Loader_PluginLoader_Exception Object ( [message:protected] => Plugin by name 'FieldSet' was not found in the registry; used paths:Zend_Form_Decorator_: Zend/Form/Decorator/ [string:private] => [code:protected] => 0 [file:protected] => /usr/share/pear/PEAR/Zend/Loader/PluginLoader.php [line:protected] => 406 [trace:private] => Array ................... How can I add the FieldSet plugin to the registry? I'm using the default Zend_Form Fieldset decorator.

    Read the article

  • exception 'Zend_Controller_Action_Exception' with message 'Action "index" does not exist and was not

    - by princyp
    Anyone know what this error means? after googling I found a bunch of sites that appear to have the same error? thanks exception 'Zend_Controller_Action_Exception' with message 'Action "index" does not exist and was not trapped in __call()' in /usr/local/zend/apache2/htdocs/pintsy/lib/Zend/Controller/Action.php:485 Stack trace: #0 /usr/local/zend/apache2/htdocs/pintsy/lib/Zend/Controller/Action.php(515): Zend_Controller_Action->__call('indexAction', Array) #1 /usr/local/zend/apache2/htdocs/pintsy/lib/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('indexAction') #2 /usr/local/zend/apache2/htdocs/pintsy/lib/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #3 /usr/local/zend/apache2/htdocs/pintsy/html/index.php(114): Zend_Controller_Front->dispatch() #4 {main}

    Read the article

  • About unit testing a function in the zend framework and unit testing in general

    - by sanders
    Hello people, I am diving into the world of unit testing. And i am sort of lost. I learned today that unit testing is testing if a function works. I wanted to test the following function: public function getEventById($id) { return $this->getResource('Event')->getEventById($id); } So i wanted to test this function as follows: public function test_Event_Get_Event_By_Id_Returns_Event_Item() { $p = $this->_model->getEventById(42); $this->assertEquals(42, EventManager_Resource_Event_Item_Interface); $this->assertType('EventManager_Resource_Event_Item_Interface', $p); } But then I got the error: 1) EventTest::test_Event_Get_Event_By_Id_Returns_Event_Item Zend_Db_Table_Exception: No adapter found for EventManager_Resource_Event /home/user/Public/ZendFramework-1.10.1/library/SF/Model/Abstract.php:101 /var/www/nrka2/application/modules/eventManager/models/Event.php:25 But then someone told me that i am currently unit testing and not doing an integration test. So i figured that i have to test the function getEventById on a different way. But I don't understand how. What this function does it just cals a resource and returns the event by id.

    Read the article

  • Check if a Mail folder exists using Zend Mail

    - by Ali
    How can I check if an email folder exists using Zend_Mail_Storage_Imap, theres a createFOlder, renameFOlder and removeFolder and also a getFOlders but not exactly any fixed method to query if a certain mail folder exists? The GetFOlders returns a humonogous tree of folders to start with.

    Read the article

  • Problem with displaying and downloading email attachments using the zend framework

    - by Ali
    Hi guys I'm trying to display emails in my inbox and their respective attachments. At the same time I also wish to be able to download the attachments however I'm kinda stuck here. Here is the code I use to display the attachments: $one_message = $mail->getMessage($i); $one_message->id = $i; $one_message->UID = $mail->getUniqueId($i); // get the contact of this message $email = array_pop(extract_emails_from($one_message->from)); $one_message->contactFrom = $contact_manager->get_person_from_email($email); $one_message->parts = array(); foreach (new RecursiveIteratorIterator($mail->getMessage($i)) as $ii=>$part) { try { $tpart = $part; $one_message->parts[$ii] = $tpart; // put the part of the message indexed with what I assume is its position if (strtok($part->contentType, ';') == 'text/html') { $b = $part->getContent(); $h2t->set_html($b); $one_message->body = $h2t->get_text(); } if (strtok($part->contentType, ';') == 'text/plain') { $b = $part->getContent(); $one_message->body = $part->getContent(); } } catch (Zend_Mail_Exception $e) { // ignore } } And I display the attachments using the following link: ?action=download&element=email-attachment&box=inbox&uid=<?php echo $one_message->UID;?>&id=<?php echo $one_message->id;?>&part=<?php echo $ii;?> The part variable is the index taken from the loop above However when I try to download using the exact same code as above modified slightly: $id = $_GET['id']; $pid = $_GET['part']; $one_message = $mail->getMessage($id); foreach (new RecursiveIteratorIterator($mail->getMessage($id)) as $ii=>$part) { if($pid == $ii): $content = base64_decode($part->getContent()); $cnt_typ = explode(";" , $part->contentType); $name = explode("=",$cnt_typ[1]); $filename = $name[1];//It is the file name of the attachement in browser //This for avoiding " from the file name when sent from yahoomail $filename = str_replace('"'," ",$filename); $filename = trim($filename); header("Cache-Control: public"); header("Content-Type: ".$cn_typ[1]); header("Content-Disposition: attachment; filename=\"" . $filename . "\""); header("Content-Transfer-Encoding: binary"); echo $content; exit; endif; } For some reason it doesn't work at all. I did a var dump and noticed that in the for loop with the reverseiterator teh indexes $ii returned are 1 - 2 - 2 !! Whats going on here how can the indexes be repeated? How can I tell one part from the others?

    Read the article

  • Need help with Zend Framework dynamic Namespaces

    - by Marcus Sjölin
    I want to make my system redirect unknown requests such as www.address.com/a_company to the adress www.address.com/companies/company/ and display the company a_company if it exists in the database, otherwise throw the user to a 404 not found page. So in detail, I want to make namespace that is as the first example dynamically, if the company exist in the database, I have no problem connecting to the database and retrieving information or finding a way to parse a company name, I just need help how to make my system check and run a function every time the address doesn't exist and show the second page (/companies/company/).. I am using an Acl as well, but I think it should be fine if the page is /companies/company and then possibly add /?c=a_company or similar. Thank you. /Marcus

    Read the article

  • Zend Navigation not working on dynamic pages

    - by azz0r
    XML Home default default index index Clips video clip index All video clip all 0-9 1 My bootstrap route: $router->addRoute('clips/page', new Zend_Controller_Router_Route('clips/:page', array('module' => 'video', 'controller' => 'clip', 'action' => 'all'))); The clips navigation works, but the all navigation doesnt have a crumb bar for /clips/1 Ideas?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >