[fw-general] re[fw-general] ceiving multiple parameters with the same name
Hi, an external application posts multiple parameters with the same name to my application, the equivalent of this: {users:[739,741,745],instruments:[47]} when I use getParams I can only retrieve the last userId out of the list. How could I retrieve the value of the users parameter as an array? Thanks for the help. SWK -- View this message in context: http://www.nabble.com/receiving-multiple-parameters-with-the-same-name-tp22283415p22283415.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] re[fw-general] ceiving multiple parameters with the same name
I assume it is being sent like this: users=739users=741users=745 You cannot use $_POST, $_GET or $_REQUEST because these are arrays so each value is overwriting each other. I assume this is how getParams() gets its get and post values. So you need the original string which you can then parse. This is simple enough using $_SERVER['QUERY_STRING'] but this only works for get data. Since this is being posted you will have to use something like $HTTP_RAW_POST_DATA which will only work if you have always_populate_raw_post_data turned on in your php.ini or .htaccess See: http://us3.php.net/manual/en/reserved.variables.httprawpostdata.php http://us3.php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data Mark On Mon, Mar 2, 2009 at 1:29 AM, Ralikwen balazs.kl...@gmail.com wrote: Hi, an external application posts multiple parameters with the same name to my application, the equivalent of this: {users:[739,741,745],instruments:[47]} when I use getParams I can only retrieve the last userId out of the list. How could I retrieve the value of the users parameter as an array? Thanks for the help. SWK -- View this message in context: http://www.nabble.com/receiving-multiple-parameters-with-the-same-name-tp22283415p22283415.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Have fun or die trying - but try not to actually die.
[fw-general] Re: Using custom router. Where exactly?
vadim gavrilov wrote: Where exactly do you place the router? In the bootstrap file? in the index? How can you make a custom router for each module you have? Examples will be highly appreciated. You can take a look at Matthews Pastebin application. He uses a modular directory structure and each module has its own bootstrap class. In these classes you have access to the Initialize plugin and the frontcontroller instance. http://github.com/weierophinney/pastebin/blob/b796ad0e5905e46b312a5b904a2a80c3ed8ff808/library/My/Plugin/Initialize.php http://github.com/weierophinney/pastebin/blob/b796ad0e5905e46b312a5b904a2a80c3ed8ff808/application/modules/spindle/Bootstrap.php Now you can use the getRouter() method of the frontcontroller and then add new custom routes with addRoute(). Hope this helps.
Re: [fw-general] Re: Using custom router. Where exactly?
Thanks i already looked at those files. Still can i place an instance of the addRoute inside a certain controller? or do i need to place it somewhere in the bootstarp file? Basically what i would like to do is to make a file that will hold all the routes for each module/controller. Did anyone made something like that before? Thanks. On Mon, Mar 2, 2009 at 2:22 PM, Jens Kleikamp j...@codes-concepts.comwrote: vadim gavrilov wrote: Where exactly do you place the router? In the bootstrap file? in the index? How can you make a custom router for each module you have? Examples will be highly appreciated. You can take a look at Matthews Pastebin application. He uses a modular directory structure and each module has its own bootstrap class. In these classes you have access to the Initialize plugin and the frontcontroller instance. http://github.com/weierophinney/pastebin/blob/b796ad0e5905e46b312a5b904a2a80c3ed8ff808/library/My/Plugin/Initialize.php http://github.com/weierophinney/pastebin/blob/b796ad0e5905e46b312a5b904a2a80c3ed8ff808/application/modules/spindle/Bootstrap.php Now you can use the getRouter() method of the frontcontroller and then add new custom routes with addRoute(). Hope this helps. -- Vincent Gabriel. Lead Developer, Senior Support. Zend Certified Engineer.
Re: [fw-general] Re: Using custom router. Where exactly?
On Mon, Mar 2, 2009 at 13:33, vadim gavrilov vadim...@gmail.com wrote: Thanks i already looked at those files. Still can i place an instance of the addRoute inside a certain controller? or do i need to place it somewhere in the bootstarp file? Basically what i would like to do is to make a file that will hold all the routes for each module/controller. Did anyone made something like that before? The best file is for me routes.ini. in config directory;-) The rest in bootstrap initRoutes. Regards, pch -- Paweł Chuchmała pawel.chuchmala at gmail dot com
Re: [fw-general] Re: Using custom router. Where exactly?
Any example for this? Since i saw that Matthew didn't use any router. 2009/3/2 Paweł Chuchmała pawel.chuchm...@gmail.com On Mon, Mar 2, 2009 at 13:33, vadim gavrilov vadim...@gmail.com wrote: Thanks i already looked at those files. Still can i place an instance of the addRoute inside a certain controller? or do i need to place it somewhere in the bootstarp file? Basically what i would like to do is to make a file that will hold all the routes for each module/controller. Did anyone made something like that before? The best file is for me routes.ini. in config directory;-) The rest in bootstrap initRoutes. Regards, pch -- Paweł Chuchmała pawel.chuchmala at gmail dot com -- Vincent Gabriel. Lead Developer, Senior Support. Zend Certified Engineer.
[fw-general] Re: [fw-mvc] Re: [fw-general] Re: Using custom router. Where exactly?
Routes should be defined in a bootstrap or in a routeStartup() of a front controller plugin. When the dispatch loop reaches the controller, the router has already been invoked so any rules you add inside controllers are useless (they can still be used to generate URLs in the controller and view, but without the corresponding routing rule the URLs generated would probably lead to nowhere unless the said rule is a subset of an existing rule or the default one). Module-specific rules are impossible for the same reason. The closest thing to such a thing is to have rules defined in module bootstraps which are loaded in every request. They are not really module-specific rules though, but merely routing rules that are organized per module. I do exactly that in http://code.google.com/p/mz-project/ . -- Mon On Mon, Mar 2, 2009 at 8:33 PM, vadim gavrilov vadim...@gmail.com wrote: Thanks i already looked at those files. Still can i place an instance of the addRoute inside a certain controller? or do i need to place it somewhere in the bootstarp file? Basically what i would like to do is to make a file that will hold all the routes for each module/controller. Did anyone made something like that before? Thanks. On Mon, Mar 2, 2009 at 2:22 PM, Jens Kleikamp j...@codes-concepts.comwrote: vadim gavrilov wrote: Where exactly do you place the router? In the bootstrap file? in the index? How can you make a custom router for each module you have? Examples will be highly appreciated. You can take a look at Matthews Pastebin application. He uses a modular directory structure and each module has its own bootstrap class. In these classes you have access to the Initialize plugin and the frontcontroller instance. http://github.com/weierophinney/pastebin/blob/b796ad0e5905e46b312a5b904a2a80c3ed8ff808/library/My/Plugin/Initialize.php http://github.com/weierophinney/pastebin/blob/b796ad0e5905e46b312a5b904a2a80c3ed8ff808/application/modules/spindle/Bootstrap.php Now you can use the getRouter() method of the frontcontroller and then add new custom routes with addRoute(). Hope this helps. -- Vincent Gabriel. Lead Developer, Senior Support. Zend Certified Engineer.
Re: [fw-general] Re: [fw-mvc] Re: [fw-general] Re: Using custom router. Where exactly?
Thanks, I will sure looking at the way your doing it. On Mon, Mar 2, 2009 at 3:53 PM, Mon Zafra mon...@gmail.com wrote: Routes should be defined in a bootstrap or in a routeStartup() of a front controller plugin. When the dispatch loop reaches the controller, the router has already been invoked so any rules you add inside controllers are useless (they can still be used to generate URLs in the controller and view, but without the corresponding routing rule the URLs generated would probably lead to nowhere unless the said rule is a subset of an existing rule or the default one). Module-specific rules are impossible for the same reason. The closest thing to such a thing is to have rules defined in module bootstraps which are loaded in every request. They are not really module-specific rules though, but merely routing rules that are organized per module. I do exactly that in http://code.google.com/p/mz-project/ . -- Mon On Mon, Mar 2, 2009 at 8:33 PM, vadim gavrilov vadim...@gmail.com wrote: Thanks i already looked at those files. Still can i place an instance of the addRoute inside a certain controller? or do i need to place it somewhere in the bootstarp file? Basically what i would like to do is to make a file that will hold all the routes for each module/controller. Did anyone made something like that before? Thanks. On Mon, Mar 2, 2009 at 2:22 PM, Jens Kleikamp j...@codes-concepts.comwrote: vadim gavrilov wrote: Where exactly do you place the router? In the bootstrap file? in the index? How can you make a custom router for each module you have? Examples will be highly appreciated. You can take a look at Matthews Pastebin application. He uses a modular directory structure and each module has its own bootstrap class. In these classes you have access to the Initialize plugin and the frontcontroller instance. http://github.com/weierophinney/pastebin/blob/b796ad0e5905e46b312a5b904a2a80c3ed8ff808/library/My/Plugin/Initialize.php http://github.com/weierophinney/pastebin/blob/b796ad0e5905e46b312a5b904a2a80c3ed8ff808/application/modules/spindle/Bootstrap.php Now you can use the getRouter() method of the frontcontroller and then add new custom routes with addRoute(). Hope this helps. -- Vincent Gabriel. Lead Developer, Senior Support. Zend Certified Engineer. -- Vincent Gabriel. Lead Developer, Senior Support. Zend Certified Engineer.
Re: [fw-general] User uploads file bigger than what's allowed in php.ini, can it be caught?
Thanks Thomas. I downloaded the trunk code today and now the script finds out that a file was submitted with a size bigger than what's allowed in php.ini. So that's great now. However, I found out the upload script is now only working about 50% of the times I tried it. I'll dive into my code once more to find out what's causing this. thomasW wrote: You have 3 possible solutions: 1) Use trunk release 2) Wait for the next minor release which will be 1.8 3) Make a workaround yourself by looking at the trunk code and integrate it into your application To note: This is a PHP only problem due to the fact that PHP provides an empty $_FILES array when the post_max_* setting was exceeded by the form. You can also find other solutions which you could integrate manually by looking at the PHP manual. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com -- View this message in context: http://www.nabble.com/User-uploads-file-bigger-than-what%27s-allowed-in-php.ini%2C-can-it-be-caught--tp21936346p2226.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Invalid XHTML attribute in Zend_Form_Element
-- Luiz A Brandao Jr fromv...@gmail.com wrote (on Monday, 02 March 2009, 12:03 AM -0300): I was trying to validate a page and verified that a Zend Form element creates an invalid XHTML attribute helper. Like helper=formText. How can I prevent it from rendering? Not that I unconditionally need my page to be valid but I'd like to. I tried $myElement-setAttrib('helper', null); but it gives an error when the Zend_Form_Decorator_ViewScript decorator is called. The 'helper' property of the shipped elements are used to hint to the ViewHelper decorator which view helper to utilize. In most cases, that attribute is removed before calling the view helper itself to prevent its inclusion in the actual rendered element. If you can detail which elements do *not* work this way, I'll try and correct the issue. BTW, there's a mismatch between the available (X)HTML validators and the actual (X)HTML specifications -- the specifications actually allow for arbitrary attributes. Unfortunately, the validators do not -- which is wrong. -- Matthew Weier O'Phinney Software Architect | matt...@zend.com Zend Framework | http://framework.zend.com/
Re: [fw-general] Re: Using custom router. Where exactly?
-- vadim gavrilov vadim...@gmail.com wrote (on Monday, 02 March 2009, 03:15 PM +0200): Any example for this? Since i saw that Matthew didn't use any router. The router is used on every request -- I simply wasn't defining any custom *routes* -- and herein lies your confusion, I think. Zend_Controller_Router_Regex is registered with the front controller by default. This router, by default, registers a route that corresponds to (:module/):controller/:action/*. I you want any additional routes, you must register them yourself -- and you must do so *before* the router is invoked. Router invocation is the first part of the front controller's dispatch() routine. You have two places you can then register routes: your bootstrap, or in a routeStartup() plugin. The current stable pastebin app uses an Initialize plugin that is registered with routeStartup(), and could be easily modified to do route initialization if necessary. On the whole, however, it's rare that you will need to do explicit, custom routes per controller; if you are, you may want to re-think your routing strategy to make it more predictable and uniform. As for custom routes per module, you have several options. * In your bootstrap, loop through each module directory and check for a route bootstrap (a similar tack is taken in the upcoming Zend_Application), configuration file, and/or plugin. * Use a config file to define routes for your entire application. * Use a routeStartup() plugin that checks each module directory for a configuration file defining routes for that module. 2009/3/2 Pawe Chuchma a pawel.chuchm...@gmail.com On Mon, Mar 2, 2009 at 13:33, vadim gavrilov vadim...@gmail.com wrote: Thanks i already looked at those files. Still can i place an instance of the addRoute inside a certain controller? or do i need to place it somewhere in the bootstarp file? Basically what i would like to do is to make a file that will hold all the routes for each module/controller. Did anyone made something like that before? The best file is for me routes.ini. in config directory;-) The rest in bootstrap initRoutes. Regards, pch -- Pawe Chuchma a pawel.chuchmala at gmail dot com -- Vincent Gabriel. Lead Developer, Senior Support. Zend Certified Engineer. -- Matthew Weier O'Phinney Software Architect | matt...@zend.com Zend Framework | http://framework.zend.com/
Re: [fw-general] Re: Using custom router. Where exactly?
In one of my apps: routes.ini: routes.main.type = Zend_Controller_Router_Route_Regex routes.main.route = (main.php|index.html) routes.main.defaults.controller = index routes.main.defaults.action = index (...) Initialize.php class XXX_Plugin_Initialize extends Zend_Controller_Plugin_Abstract { (...) public function routeStartup(Zend_Controller_Request_Abstract $request) { $this-initRoutes(); (...) } public function initRoutes() { $router = $this-_front-getRouter(); $routing_config = new Zend_Config_Ini($this-_appPath . '/config/routes.ini', 'production'); $router-addConfig($routing_config, 'routes'); } } index.php or bootstrap.php or something like this (...) $front-registerPlugin(new XXX_Plugin_Initialize((...))) -addControllerDirectory(APPLICATION_PATH . '/controllers'); (...) regards, pch 2009/3/2 vadim gavrilov vadim...@gmail.com: Any example for this? Since i saw that Matthew didn't use any router. 2009/3/2 Paweł Chuchmała pawel.chuchm...@gmail.com On Mon, Mar 2, 2009 at 13:33, vadim gavrilov vadim...@gmail.com wrote: Thanks i already looked at those files. Still can i place an instance of the addRoute inside a certain controller? or do i need to place it somewhere in the bootstarp file? Basically what i would like to do is to make a file that will hold all the routes for each module/controller. Did anyone made something like that before? The best file is for me routes.ini. in config directory;-) The rest in bootstrap initRoutes. Regards, pch -- Paweł Chuchmała pawel.chuchmala at gmail dot com -- Vincent Gabriel. Lead Developer, Senior Support. Zend Certified Engineer. -- Paweł Chuchmała pawel.chuchmala at gmail dot com
Re: [fw-general] Zend_Mail Zend_Mail_Transport_Sendmail (ZF 1.7.5) bugs. Can somebody confirm?
Hi strange-looking-man! That's more a problem with mail() under Windows that can't be solved in ZF. But as it uses SMTP anyway you could just switch to the SMTP transport. Use ini_get() to get the same settings from your php.ini. nico fire-eyed-...@hotmail.com wrote: Hi all, Can anybody confirm that the latest Zend_Mail has the following bugs in combination with Zend_Mail_Transport_Sendmail. I'm not sure whether this relates to Zend_Mail_Transport_Smtp too. 1) Cc and Bcc recipients are also added to the To list: I think I traced this down to the following lines in the following methods: Zend_Mail::_addRecipientAndHeader() $this-_recipients[$email] = 1; Zend_Mail::getRecipients() return array_keys($this-_recipients); Zend_Mail_Transport_Abstract::send() $this-recipients = implode(',', $mail-getRecipients()); Zend_Mail_Transport_Sendmail::_sendMail() $result = mail( $this-recipients, etc... The first argument for mail() should only contain To addresses, not all addresses. This could very well only be related to Windows as per Zend_Mail_Transport_Sendmail::_prepareHeaders() if (0 === strpos(PHP_OS, 'WIN')) { etc... Can somebody confirm that this is accurate? 2) Cc's with $name gives 'SMTP server response: 501 5.5.4 Invalid Address' This could very well be related to bug 1 because the first argument to the mail() call now contains invalid filtered Cc addresses. Please confrim this with me, so I will file a bug report. Cheers System: OS: Windows XP SP3 Webserver: Apache 2.2.9 PHP: 5.2.6 _ Blijf altijd op de hoogte van wat jouw vrienden doen http://home.live.com
[fw-general] Zend_Controller_Router_Route_Translatable is ready for review
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi people, I have just finisehd the proposal for the translatable route. I welcome any comments and ideas for it. http://framework.zend.com/wiki/display/ZFPROP/Zend_Controller_Router_Route_Translatable+-+Ben+Scholzen Regards, Ben - -- ... : ___ _ ___ ___ ___ _ ___: : | \ /_\ / __| _ \ _ (_) \ : : | |) / _ \\__ \ _/ / | |) | : : |___/_/:\_\___/_| |_|_\_|___/ : ::: : Web: http://www.dasprids.de : : E-mail : m...@dasprids.de : : Jabber : jab...@dasprids.de : : ICQ: 105677955 : ::: -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmsBpEACgkQ0HfT5Ws789CcigCgntEQ/QA2oY3LcnA8zycNcK7H TfUAnR6+NiKK7muL26k/FUGY+9gbfnK3 =wQBE -END PGP SIGNATURE-
Re: [fw-general] Input (file) from ini
ive even gone this route in the controller with no luck $logo = $this-_advertiserCreateForm-getElement('logo'); $logo-setAttribs(array(size=13)) -setDestination('usr/logos') -addValidator('Size', false, 102400) // limit to 100K -setMaxFileSize(102400) // limits the filesize on the client side -addValidator('Extension', false, 'jpg,png,gif'); Bob O wrote: hello, im having trouble getting my file input field to get the attribs from my ini file i get the element to display, but the attribs do not.. here is my code reseller.advertiserCreate.elements.logo.type = file reseller.advertiserCreate.elements.logo.options.label = Logo: reseller.advertiserCreate.elements.logo.options.required = false reseller.advertiserCreate.elements.logo.options.attribs.size = 13 reseller.advertiserCreate.elements.logo.options.attribs.class = logo_input reseller.advertiserCreate.elements.logo.options.attribs.tabIndex = 2 reseller.advertiserCreate.elements.logo.options.attribs.alt = Logo Upload Field reseller.advertiserCreate.elements.logo.options.destination = usr/logos reseller.advertiserCreate.elements.logo.options.decorators.type = ViewHelper any help would be great - Bob Hanson Web Developer SLC, UT -- View this message in context: http://www.nabble.com/Input-%28file%29-from-ini-tp22274917p22291940.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Override escape value for certain subform elements
How do I override the 'escape' value for a given element inside of a subForm? Is this correct? $this-getSubForm('shiptoaddress')-getElement('country')-addDecorator('Errors')-setOption('escape',false); -- View this message in context: http://www.nabble.com/Override-escape-value-for-certain-subform-elements-tp22293199p22293199.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] manipulating the window url without a refresh
thanks guys! i think i have this working now. one last question though. when i use changeUrl in the call to dojo.back.addToHistory i have backslashes in the Url that i want to add to the hash. when i do that, changeUrl automatically encodes it to %2F. is there any way for me to actually get the '/' character to show up?? thanks again Matthew Weier O'Phinney-3 wrote: -- mapes911 mapes...@gmail.com wrote (on Friday, 27 February 2009, 10:00 AM -0800): sweet. you guys rock!! i'll give this a try tonight. i did a quick search of code in pastebin and didn't find dojo.back. perhaps he didn't use it? I did use it -- it's in both the main and bugapp branches. Look in the js-src directory for references -- dojo.back is client-side, after all. :) anyway, i found some example code so i'm going to give this a whirl. question that pops into my head now is this: let's say a user bookmarks a url. this url will now probably have a hash mark in it. so for me to be able to load the correct content, do i create a dojo.onload (callback) routine that will read the stuff after the hash and determine what controller/action combo to call and load into my content div? Yes, exactly. am i on the right track? thanks again Filip Wirefors wrote: Hi, dojo.back has the kind of functionality you are looking for. I used dojo.back in conjunction with dijit.layout.ContentPane to be able to use the browsers back/forward butons and bookmarking. Some info on the subject can be found here: http://docs.dojocampus.org/dojo/back And if I'm not mistaken, Matthew uses dojo.back in his pastebin app. /Filip Hi all, I am developing an application that uses ajax/dojo.xhrget calls often to manipulate certain divs within a page. I would like to be able to update the url in the browser as the user clicks different areas so that if a user decided to bookmark the page, they would be able to return to the same page with the right content loaded in the container div. I've seen solutions in other forms where they use the parent.location.hash = URL; but this only works if you have a # mark within your url and you are modifying the part of the url after the # Does anyone here know of a way to do this with zend framework?? _ Svårt att hålla kontakten med släkt vänner? Skaffa Messenger nu! http://download.live.com/messenger -- View this message in context: http://www.nabble.com/manipulating-the-window-url-without-a-refresh-tp22241256p22251070.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Matthew Weier O'Phinney Software Architect | matt...@zend.com Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/manipulating-the-window-url-without-a-refresh-tp22241256p22294989.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Zend Framework 1.7.6 is now available!
Hi all, It is my pleasure to announce the release of Zend Framework 1.7.6! You can download this new mini release from the ZF download site: http://framework.zend.com/download/latest/ A list of all issues resolved in this release can be found at: http://framework.zend.com/issues/secure/IssueNavigator.jspa?requestId=10 953 We'd like to once again thank our generous Zend Framework contributors for all the effort they have put in to this release and the project as a whole. Enjoy! ,Wil
RE: [fw-general] Re: How to dispatch a 404 error
-Original Message- From: news [mailto:n...@ger.gmane.org] On Behalf Of Colin Guthrie Sent: 27 February 2009 14:56 To: fw-general@lists.zend.com Subject: [fw-general] Re: How to dispatch a 404 error 'Twas brillig, and gllop at 27/02/09 10:07 did gyre and gimble: I'm trying to thow a Zend_Controller_Action_Exception to dispatch a 404 page error. The ErrorController and the Plugin_Handler instance are already implemented but I don't know how can i exactly dispatch the exception. I supose it will be something like: throw new Zend_Controller_Action_Exception('Error exception'); But this don't render my corresponent 404 page. I get only Error exception message. Any help would be apreciated. Thx! Not sure if it's the right approach but I have a nonfound action in my default module's error controller. I _forward to this from indexAction if I don't handle the error in some other way. In some cases I also specifically forward to this action. public function notfoundAction() { $this-getResponse()-setRawHeader('HTTP/1.1 404 Not Found'); $this-getResponse()-appendBody('pNot found/p'); } There are probably more elegant ways to get the same result tho'. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] I not so sure this will help you but here is my errorAction from ErrorController public function errorAction() { $errors = $this-_getParam('error_handler'); switch ($errors-type) { case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER: $this-view-message = No controller is available to service your request.; $this-getResponse()-setRawHeader('HTTP/1.1 404 Not Found'); break; case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION: // 404 error -- controller or action not found $this-getResponse()-setRawHeader('HTTP/1.1 404 Not Found'); $this-view-title = 'HTTP/1.1 404 Not Found'; $this-view-message = Sorry the page you requested has not been found.; break; default: // application error; display error page, but don't change // status code $this-view-title = 'Application Error'; $this-view-message = An unexpected error has occured, please copy and paste the message below and mail to a href=\mailto:webmas...@tenenbaum.co.uk\;webmas...@tenenbaum.co.uk/abr /br /; $this-view-message .= code.$errors-exception./code; break; } } You could replace the default action etc... Hope this helps, Simon Griffiths
RE: [fw-general] lastInsertId()
-Original Message- From: Bob O [mailto:b...@electricgraffitti.com] Sent: 27 February 2009 20:31 To: fw-general@lists.zend.com Subject: Re: [fw-general] lastInsertId() FYI..all 3 tables have auto_incrementing id fields that are PK's and when all parts pertaining my problem i am able to submit all of the other information correctly.. Bob O wrote: Im having a heck of a time with this one..I have searched high and low, and what has seemed to be a remedy isnt working for me.. any help would be great I have 1 form and 3 tables that i submit to with 1 post. These tables are joined by ids [snip] - Bob Hanson Web Developer SLC, UT To follow up on Jason's post here is some code I use here to insert into a master table (contact), do a lookup on a lookup table (contact_category) and then insert to the relation table (FK, contact_area) HTH, // Insert the main contact information into the database; $contact = new CustomerContact(); $data = array( 'co_title' = $form-getValue('title'), 'co_firstname' = $form-getValue('firstname'), 'co_lastname' = $form-getValue('lastname'), 'co_companyname'= $form-getValue('companyname'), 'co_email' = $form-getValue('email'), 'co_querytext' = $form-getValue('querytext') ); $contactid = $contact-insert($data); // Insert the query area into contact_area if ($form-getValue('queryarea')) { // Match the query area to contct_categories and insert. // loop through the query area array and find update foreach ($form-getValue('queryarea') as $key) { // Create a zend_db_table instance of contact category $contactCategory = new ContactCategory(); // find the id of the key passed from the form $catid = $contactCategory-fetchRow($contactCategory-select()-from($contactCategory ,'ct_id') -where('ct_name = ?',$key)); // create an instance of our contact area db $contactArea = new ContactArea(); // fill out the data $contactAreaData = array( 'ca_co_id' = $contactid, 'ca_ct_id' = $catid-ct_id ); // commit the data to the db $contactArea-insert($contactAreaData); } }
Re: [fw-general] How to dispatch a 404 error
Try this: throw new Zend_Controller_Action_Exception('Error exception', 404); Should work :) Giuliano gllop wrote: I'm trying to thow a Zend_Controller_Action_Exception to dispatch a 404 page error. The ErrorController and the Plugin_Handler instance are already implemented but I don't know how can i exactly dispatch the exception. I supose it will be something like: throw new Zend_Controller_Action_Exception('Error exception'); But this don't render my corresponent 404 page. I get only Error exception message. Any help would be apreciated. Thx! -- View this message in context: http://www.nabble.com/How-to-dispatch-a-404-error-tp22242790p22298475.html Sent from the Zend Framework mailing list archive at Nabble.com.