[fw-general] AjaxLink in ZendX_JQuery
Hi I think it could be useful to have an extra datatype option in AjaxLink View Helper: the javascript option to eval the server's response in the client. -- Xavier Vidal Piera Director Tècnic de Citrusparadis.com - Grupo Intercom Enginyer Tècnic Informàtic de Gestió Tècnic Especialista Informàtic d'equips [EMAIL PROTECTED] http://web.xaviervidal.net 610.68.41.78
Re: [fw-general] AjaxLink in ZendX_JQuery
Hello Xavier. This is already possible, you can plug the option 'dataType' = 'javascript' into the ajaxLink helper. For example: ?= $this-ajaxLink(test, hello.html, array('dataType' = 'script'), array()); ? This would switch to interpreting the response to execute included javascript. Important is to use 'script', not javascript. As it proxies directly to the dataType options that can be given to jQuery $.get and $.post. On Wednesday 19 November 2008 09:15:02 Xavier Vidal Piera wrote: Hi I think it could be useful to have an extra datatype option in AjaxLink View Helper: the javascript option to eval the server's response in the client. -- Benjamin Eberlei http://www.beberlei.de
[fw-general] Zend_Form - a bit more complex forms
Hi. Let me show an example: http://zielinski.civ.pl/test/form/form.html I must create some kind of inquiry form, which is and probably will be more complex than typical web forms. Of course I know that decorators exists. However this time I failed. I`ve no idea how to use h2 nor checkbox with label and input after it like showed in example with option other. Thanks for any suggestion. -- View this message in context: http://www.nabble.com/Zend_Form---a-bit-more-complex-forms-tp20579513p20579513.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Trying to get Zend OpenID working with various providers
Hi, I am having huge problems getting Zend OpenID working with different providers, I keep getting strange errors for some of them. First things first - here is my code: $status = ; /** * Includes and loads */ ini_set('include_path', ini_get('include_path') . ':/usr/home/www/domain.com/'); require_once('Zend/Loader.php'); Zend_Loader::registerAutoload(); Zend_Loader::loadClass('Zend_OpenId'); $sreg = new Zend_OpenId_Extension_Sreg ( array ( 'nickname' = true , 'email' = true , 'fullname' = false ), null, 1.1); /** * Are we posting - i.e. initial post? */ if (isset ($_POST['openid_action']) $_POST['openid_action'] == Register ! empty ($_POST['openid_url'])) { $consumer = new Zend_OpenId_Consumer (); if (! $consumer-login ($_POST['openid_url'], 'http://domain.com/register/openid.php', 'http://domain.com/register/', $sreg)) $status = OpenID login failed.br; } /** * We are on our way back from openid! */ else if (isset ($_GET['openid_mode'])) { if ($_GET['openid_mode'] == id_res) { $consumer = new Zend_OpenId_Consumer (); if ($consumer-verify ($_GET, $id, $sreg)) { $data = $sreg-getProperties(); $status = VALID . htmlspecialchars ($id); } else $status = INVALID . htmlspecialchars ($id). . $consumer-getError(); } else if ($_GET['openid_mode'] == cancel) $status = CANCELED; } Then some HTML below that to display errors etc. This is basically a copy from the Zend OpenID manual - but here are my problems. If I use myopenid.com it works fine and this is whats in $_GET (I get a VALID: MY NAME): Array ( [openid_assoc_handle] = {HMAC-SHA256}{4911faf5}{l7eVqQ==} [openid_claimed_id] = http://myname.myopenid.com/ [openid_identity] = http://myname.myopenid.com/ [openid_mode] = id_res [openid_ns] = http://specs.openid.net/auth/2.0 [openid_ns_sreg] = http://openid.net/extensions/sreg/1.1 [openid_op_endpoint] = http://www.myopenid.com/server [openid_response_nonce] = 2008-11-19T13:49:23ZS6e6YZ [openid_return_to] = http://domain.com/register/openid.php [openid_sig] = cfYueopSnApXabnFmvTVioIjZGtHiGlfRLMR//qgkv0= [openid_signed] = assoc_handle,claimed_id,identity,mode,ns,ns.sreg,op_endpoint,response_nonce,return_to,signed,sreg.email,sreg.fullname,sreg.nickname [openid_sreg_email] = [EMAIL PROTECTED] [openid_sreg_fullname] = Ian Barnes [openid_sreg_nickname] = MyNickname ) Fine - so that works. Now if I use yahoo it doesnt work - I get INVALID: MY NAME and the error is: Extension::prepareResponse failure and this is the output from $_GET: Array ( [openid_ns] = http://specs.openid.net/auth/2.0 [openid_mode] = id_res [openid_return_to] = http://domain.com/register/openid.php [openid_claimed_id] = https://me.yahoo.com/username#a4a7e [openid_identity] = https://me.yahoo.com/username [openid_assoc_handle] = eXncxRXNH4wDdDamIbv3BtuAZF0EKJ7wLSONTDJ4KmZWzA6roD6165GfRgpbcTS86aaCJLhdYHNC5fcMHxOd7M9ZyUnPLisioKB9MTZiBvBP7MLuroRHqqVa3S36Ca.c [openid_realm] = http://domain.com/register/ [openid_response_nonce] = 2008-11-19T13:54:29ZfrIgw42XFBnGXmjHgD4rL69Eq0vS8byb2w-- [openid_signed] = assoc_handle,claimed_id,identity,mode,ns,ns.pape,op_endpoint,pape.auth_policies,pape.nist_auth_level,response_nonce,return_to,signed [openid_op_endpoint] = https://open.login.yahooapis.com/openid/op/auth [openid_ns_pape] = http://specs.openid.net/extensions/pape/1.0 [openid_pape_auth_policies] = none [openid_pape_nist_auth_level] = 0 [openid_sig] = vHXcHwsszQDSki/fNRIixrWS6u4= ) So it appears to have worked, except claimed_id has the #a4e7e part extra after the username?? Now for wordpress I go through the motions, come back and get the following error: Extension::prepareResponse failure (same as Yahoo). Here is $_GET: Array ( [openid_assoc_handle] = {HMAC-SHA1}{4923e2f0}{Wm/HzQ==} [openid_identity] = http://myusername.wordpress.com/ [openid_mode] = id_res [openid_return_to] = http://domain.com/register/openid.php [openid_sig] = BHvUkkAToOKNvU3+3K+OWPTL9l0= [openid_signed] = mode,identity,return_to ) Im using Zend Framework 1.7 (latest) with no customisations. Anyone have any ideas as to why some work and some dont ? Thanks Ian
Re: [fw-general] Zend_Form - a bit more complex forms
Hi Michal, Personally, I like to delegate building my form to a formbuilder that knows how to add the decorators. However, If you want to do it the basic way, you are probably looking for something like adding an aliased HtmlTag decorator with Tag h2 and placement PREPEND and set the contents to your title for the question. $multiCheckbox-addDecorator(new Zend_Form_Decorator(array('h2' = 'HtmlTag'), array('tag' = 'h2', 'placement' = 'prepend')); There are probably some errors in here, but this is the idea. Oh, and you will need to set some content on your decorator. Bart Michał Zieliński schreef: Hi. Let me show an example: http://zielinski.civ.pl/test/form/form.html I must create some kind of inquiry form, which is and probably will be more complex than typical web forms. Of course I know that decorators exists. However this time I failed. I`ve no idea how to use h2 nor checkbox with label and input after it like showed in example with option "other". Thanks for any suggestion. -- Bart McLeod Space Web Internet Team Middenlaan 47 6865 VN Heveadorp The Netherlands t +31(0)26 3392952 m 06 51 51 89 71 @ [EMAIL PROTECTED] www.spaceweb.nl Bart McLeod is a Zend Certified Engineer. Click to verify!
[fw-general] PDF, IE7 and sessions
Hi list, This might be off-topic as I couldn't tell if the problem is caused by IE, PHP, Zend_Pdf or Adobe Reader. Using PHP 5.2.4, ZF trunk r12700, IE7, Adobe Reader 9 ?php require_once 'Zend/Pdf.php'; $pdf = new Zend_Pdf(); $pdf-pages[] = $pdf-newPage(Zend_Pdf_Page::SIZE_A4); session_start(); header('Content-Type: application/pdf'); echo $pdf-render(); This should render a PDF with a single blank page. However, IE7 returns a general error Internet Explorer cannot display the webpage. If I comment the session_start() line, the PDF is rendered fine. My problem is that I need to get some session variables first before rendering the PDF. Has anyone come across this problem, and how did you solve it? -- -- Mon
Re: [fw-general] PDF, IE7 and sessions
maybe this helps: http://fpdf.org/en/FAQ.php#q3 it should be the same problem. On Wednesday 19 November 2008 16:07:42 Mon Zafra wrote: Hi list, This might be off-topic as I couldn't tell if the problem is caused by IE, PHP, Zend_Pdf or Adobe Reader. Using PHP 5.2.4, ZF trunk r12700, IE7, Adobe Reader 9 ?php require_once 'Zend/Pdf.php'; $pdf = new Zend_Pdf(); $pdf-pages[] = $pdf-newPage(Zend_Pdf_Page::SIZE_A4); session_start(); header('Content-Type: application/pdf'); echo $pdf-render(); This should render a PDF with a single blank page. However, IE7 returns a general error Internet Explorer cannot display the webpage. If I comment the session_start() line, the PDF is rendered fine. My problem is that I need to get some session variables first before rendering the PDF. Has anyone come across this problem, and how did you solve it? -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Question about zend pagination
Matt, thanks for posting this link and quote rom documents. I've already read that before i posted in here :) How to use that in my example? Matthew Ratzloff wrote: From the documentation: The following is an example route you might use in an INI configuration file: routes.example.route = articles/:articleName/:page routes.example.defaults.controller = articles routes.example.defaults.action = view routes.example.defaults.page = 1 routes.example.reqs.articleName = \w+ routes.example.reqs.page = \d+ -- View this message in context: http://www.nabble.com/Question-about-zend-pagination-tp20543032p20582454.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] PDF, IE7 and sessions
Thank you! On Wed, Nov 19, 2008 at 11:15 PM, Benjamin Eberlei [EMAIL PROTECTED]wrote: maybe this helps: http://fpdf.org/en/FAQ.php#q3 it should be the same problem. On Wednesday 19 November 2008 16:07:42 Mon Zafra wrote: Hi list, This might be off-topic as I couldn't tell if the problem is caused by IE, PHP, Zend_Pdf or Adobe Reader. Using PHP 5.2.4, ZF trunk r12700, IE7, Adobe Reader 9 ?php require_once 'Zend/Pdf.php'; $pdf = new Zend_Pdf(); $pdf-pages[] = $pdf-newPage(Zend_Pdf_Page::SIZE_A4); session_start(); header('Content-Type: application/pdf'); echo $pdf-render(); This should render a PDF with a single blank page. However, IE7 returns a general error Internet Explorer cannot display the webpage. If I comment the session_start() line, the PDF is rendered fine. My problem is that I need to get some session variables first before rendering the PDF. Has anyone come across this problem, and how did you solve it? -- Benjamin Eberlei http://www.beberlei.de -- -- Mon
Re: [fw-general] Zend_Form - a bit more complex forms
Thanks for reply Bart. Bart McLeod wrote: Personally, I like to delegate building my form to a formbuilder that knows how to add the decorators. Interesting idea. Can you write a bit more about it? Bart McLeod wrote: However, If you want to do it the basic way, you are probably looking for something like adding an aliased HtmlTag decorator with Tag h2 and placement PREPEND and set the contents to your title for the question. $multiCheckbox-addDecorator(new Zend_Form_Decorator(array('h2' = 'HtmlTag'), array('tag' = 'h2', 'placement' = 'prepend')); There are probably some errors in here, but this is the idea. Oh, and you will need to set some content on your decorator. Thanks, I`ll test it. I tried it but I missed 'placement' element which might be the case. How about input after checkbox and label in the same line? -- View this message in context: http://www.nabble.com/Zend_Form---a-bit-more-complex-forms-tp20579513p20582703.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Question about zend pagination
Your route doesn't have a :page parameter like the example shows. -Matt On Wed, Nov 19, 2008 at 7:39 AM, vladimirn [EMAIL PROTECTED] wrote: Matt, thanks for posting this link and quote rom documents. I've already read that before i posted in here :) How to use that in my example? Matthew Ratzloff wrote: From the documentation: The following is an example route you might use in an INI configuration file: routes.example.route = articles/:articleName/:page routes.example.defaults.controller = articles routes.example.defaults.action = view routes.example.defaults.page = 1 routes.example.reqs.articleName = \w+ routes.example.reqs.page = \d+ -- View this message in context: http://www.nabble.com/Question-about-zend-pagination-tp20543032p20582454.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] [Zend_Paginator] Bug when using complex Zend_Db_Select
That's how it originally worked. There were reasons that it changed. -Matt On Tue, Nov 18, 2008 at 11:26 PM, Iulian M [EMAIL PROTECTED] wrote: Yes, but it should be noted that it will not accept ANY Zend_Db_Select object. The object passed to the setRowCount() must contain the ROW_COUNT_COLUMN = 'zend_paginator_row_count', or else it will throw an exception. In my opinion count function, that actually performs the count operation, should wrap the Zend_Db_Select object that is passed to the Zend_Paginator_Adapter_DbSelect with a select statement like : SELECT count(*) as count from ( ...pased select) as select; Matthew Ratzloff wrote: I just want to be clear that setRowCount() accepts either an integer or Zend_Db_Select object for the TOTAL row count. -Matt On Tue, Nov 18, 2008 at 12:06 PM, Iulian M [EMAIL PROTECTED] wrote: Thank you for your answer. I will consider the situation in which i will pass the calculated rowCount. Iulian Matthew Ratzloff wrote: The easiest way to solve this is to pass in your own Zend_Db_Select COUNT query to Zend_Paginator_Adapter_DbSelect::setRowCount(). http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Paginator/Adapter/DbSelect.php Hope that helps, -Matt On Tue, Nov 18, 2008 at 7:32 AM, Iulian M [EMAIL PROTECTED] wrote: I am creating a Zend_Db_Select statement for this SQL : SELECT table1.a AS a table1.b AS b COUNT(table2.a) -1 as c FROM table1 INNER JOIN table2 ON table1.a = table2.a HAVING c = 1 The select is tested and it worked as expected. The Zend_Db_Select will be used to paginate the result using Zend_Paginator_Adapter_DbSelect. Problem: When Zend_Paginator_Adapter_DbSelect::count() method is executed, to determine the total number of rows that the select will return, an error will be thrown: [message:protected] = SQLSTATE[42S22]: Column not found: 1054 Unknown column 'c' in 'having clause' This is caused by Zend_Db_Select::setRowCount() that creates an special select based on the select defined in Zend_Paginator_Adapter_DbSelect. setRowCount() alters the columns that will be used to run the select and when the fetch is issued the above error will be thrown. -- View this message in context: http://www.nabble.com/-Zend_Paginator--Bug-when-using-complex-Zend_Db_Select-tp20561842p20561842.html Sent from the Zend Framework mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/-Zend_Paginator--Bug-when-using-complex-Zend_Db_Select-tp20561842p20567204.html Sent from the Zend Framework mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/-Zend_Paginator--Bug-when-using-complex-Zend_Db_Select-tp20561842p20574556.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] How the heck do you go into production mode?
I've been developing a Zend app for awhile now. It's a project I adopted from a previous contractor and I am not the one responsible for deploying it. I've recently encountered a production bug and really need to run the app in production mode locally to figure this out. How do I run my Zend Framework app in production? It must be obvious, because it doesn't seem to be documented _anywhere_. Thanks -- View this message in context: http://www.nabble.com/How-the-heck-do-you-go-into-production-mode--tp20584031p20584031.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] How the heck do you go into production mode?
-- MrEMan [EMAIL PROTECTED] wrote (on Wednesday, 19 November 2008, 08:50 AM -0800): I've been developing a Zend app for awhile now. It's a project I adopted from a previous contractor and I am not the one responsible for deploying it. I've recently encountered a production bug and really need to run the app in production mode locally to figure this out. How do I run my Zend Framework app in production? It must be obvious, because it doesn't seem to be documented _anywhere_. Umm... we don't have a production mode. That sort of detail is usually left to the application developer, and typically via selecting the appropriate configuration section when loading your Zend_Config object. Production bugs are usually a result of (a) missing files, (b) outdated PHP versions, or (c) missing PHP extensions. -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
RE: [fw-general] How the heck do you go into production mode?
This would depend on the programmer and the style he/she used. For example, I used the zend studio MVC bootstrap/initializer style in my project. You might have something like this in the bootstrap.php in you app dir. Could also be in the index.php in the web root, if not using a bootstrap file. $frontController-registerPlugin(new Initializer('development')); All I have to do is change development to production, and I'm out of dev mode. But I'd look in the initializer file to make sure, to see if it has to be something specific. Sorry to say, but you'll just have to track it down. I'd start looking at the index.php and any configs that are loaded. It would be in the beginning of the application. Terre -Original Message- From: MrEMan [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2008 11:50 AM To: fw-general@lists.zend.com Subject: [fw-general] How the heck do you go into production mode? I've been developing a Zend app for awhile now. It's a project I adopted from a previous contractor and I am not the one responsible for deploying it. I've recently encountered a production bug and really need to run the app in production mode locally to figure this out. How do I run my Zend Framework app in production? It must be obvious, because it doesn't seem to be documented _anywhere_. Thanks -- View this message in context: http://www.nabble.com/How-the-heck-do-you-go-into-production-mode--tp2058403 1p20584031.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] How the heck do you go into production mode?
Personnaly, I use some kind of Apache setEnv + php's $_SERVER to push my app in prod mode. Julien.P 2008/11/19 Terre Porter [EMAIL PROTECTED] This would depend on the programmer and the style he/she used. For example, I used the zend studio MVC bootstrap/initializer style in my project. You might have something like this in the bootstrap.php in you app dir. Could also be in the index.php in the web root, if not using a bootstrap file. $frontController-registerPlugin(new Initializer('development')); All I have to do is change development to production, and I'm out of dev mode. But I'd look in the initializer file to make sure, to see if it has to be something specific. Sorry to say, but you'll just have to track it down. I'd start looking at the index.php and any configs that are loaded. It would be in the beginning of the application. Terre -Original Message- From: MrEMan [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2008 11:50 AM To: fw-general@lists.zend.com Subject: [fw-general] How the heck do you go into production mode? I've been developing a Zend app for awhile now. It's a project I adopted from a previous contractor and I am not the one responsible for deploying it. I've recently encountered a production bug and really need to run the app in production mode locally to figure this out. How do I run my Zend Framework app in production? It must be obvious, because it doesn't seem to be documented _anywhere_. Thanks -- View this message in context: http://www.nabble.com/How-the-heck-do-you-go-into-production-mode--tp2058403 1p20584031.htmlhttp://www.nabble.com/How-the-heck-do-you-go-into-production-mode--tp20584031p20584031.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Translate and 1.7.0PR issue/question
Hi, I just ran into the same thing. Zend_Translate under ZF 1.7 now raises these notices if you call Zend_Translate::setLocale($locale) with a $locale that has no translation data added. You can suppress these notices by passing the option 'disableNotices'=true when instantiating Zend_Translate. But I don't think that a notice makes sense in this case. As far as I understand the translation engine of ZF, if no translation is found for the requested key, Zend_Translate will always return the key itself. So, for example, you would write your application output strings in english and never worry about wrong translations beeing displayed if the language requested by the user is english. To tell the application that english is an accepted locale, I would always add the 'en' locale with an empty set of translations anyway, to benefit from methods like Zend_Translate::isAvailabe('en') and the like, and so that I may add translations into the english translation table later on if necessary (for larger texts or something). Now with notices raised on empty translation tables, the unpleasant feeling remains to do something wrong or at least unintended there. And imho suppressing the notices is usually not a good idea either, because you never know what useful hints you might miss this way. Please correct me if I am wrong, but I think this notice is not really needed. Or, more likely, I'm not getting the point. Greetings, Florian Robert Castley schrieb: Hi, I thought I would take the Preview Release for a spin. But I immediately hit an issue with Zend_Translate. My error message is: *Notice*: No translation for the language 'en_GB' available. in */Users/rwc/Sites/ZendFramework-SVN/library/Zend/Translate/Adapter.php* on line *301* ** I have a language plugin I call in my bootstrap. This works perfectly under 1.6.3, here is the code: ?php class Magik_Plugin_Language extends Zend_Controller_Plugin_Abstract { public function preDispatch(Zend_Controller_Request_Abstract $request) { $locale = new Zend_Locale(); $frontendOptions = array( 'automatic_cleaning_factor' = 0, 'cache_id_prefix' = 'Magik_', 'lifetime' = null ); $backendOptions = array( 'cache_dir' = CACHE ); $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions); Zend_Translate::setCache($cache); $options = array('scan' = Zend_Translate::LOCALE_DIRECTORY); $translate = new Zend_Translate('csv', 'languages', 'auto', $options); if ($translate-isAvailable($locale-getLanguage()) != 1) { $locale-setLocale('en'); } $translate-setLocale($locale-getLanguage()); setcookie('lang', $locale-getLanguage(), null, '/'); Zend_Registry::set('locale', $locale-getLanguage()); Zend_Registry::set('Zend_Translate', $translate); } } The other interesting thing to note is that in my cache directory with 1.6.3 I get two files, but with the PR I get loads! One for each lang file and one for each file under my CVS directory (repository, entries, root etc). I had a look at the docs online and there was some mention of Zend Locale compatibility mode which I have set to false, but still no luck. Any pointers? Cheers, - Robert This email has been scanned for all known viruses by the MessageLabs Email Security Service and the Macro 4 plc internal virus protection system.
Re: [fw-general] Zend_Translate and 1.7.0PR issue/question
The original message was not delivered to the mailinglist so I can only answer to this one... Please correct me if I am wrong, but I think this notice is not really needed. Or, more likely, I'm not getting the point. The point is, that you are trying to set a language for which no translation exists wether for the wished locale nor for the degraded locale. This would mean that in this case only the key is returned. Often users do not write out complete centences as described in the manual but simple string keys like mykey1. Even if this is sometimes wished, it is no good way of translation... because we do not translate anything in this case. And exactly for this reason this notice has been added. Still, when you think that having the key displayed as translated message is ok for you, you can disable this notice with the mentioned option. The thing is simply that not in every case it's really usefull to have the key returned. This notice is simply nothing more than a Beware... it is possible that what you requested is not what you wanted Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: Florian Sonnenburg [EMAIL PROTECTED] To: Robert Castley [EMAIL PROTECTED]; fw-general@lists.zend.com Sent: Wednesday, November 19, 2008 6:40 PM Subject: Re: [fw-general] Zend_Translate and 1.7.0PR issue/question Hi, I just ran into the same thing. Zend_Translate under ZF 1.7 now raises these notices if you call Zend_Translate::setLocale($locale) with a $locale that has no translation data added. You can suppress these notices by passing the option 'disableNotices'=true when instantiating Zend_Translate. But I don't think that a notice makes sense in this case. As far as I understand the translation engine of ZF, if no translation is found for the requested key, Zend_Translate will always return the key itself. So, for example, you would write your application output strings in english and never worry about wrong translations beeing displayed if the language requested by the user is english. To tell the application that english is an accepted locale, I would always add the 'en' locale with an empty set of translations anyway, to benefit from methods like Zend_Translate::isAvailabe('en') and the like, and so that I may add translations into the english translation table later on if necessary (for larger texts or something). Now with notices raised on empty translation tables, the unpleasant feeling remains to do something wrong or at least unintended there. And imho suppressing the notices is usually not a good idea either, because you never know what useful hints you might miss this way. Please correct me if I am wrong, but I think this notice is not really needed. Or, more likely, I'm not getting the point. Greetings, Florian Robert Castley schrieb: Hi, I thought I would take the Preview Release for a spin. But I immediately hit an issue with Zend_Translate. My error message is: *Notice*: No translation for the language 'en_GB' available. in */Users/rwc/Sites/ZendFramework-SVN/library/Zend/Translate/Adapter.php* on line *301* ** I have a language plugin I call in my bootstrap. This works perfectly under 1.6.3, here is the code: ?php class Magik_Plugin_Language extends Zend_Controller_Plugin_Abstract { public function preDispatch(Zend_Controller_Request_Abstract $request) { $locale = new Zend_Locale(); $frontendOptions = array( 'automatic_cleaning_factor' = 0, 'cache_id_prefix' = 'Magik_', 'lifetime' = null ); $backendOptions = array( 'cache_dir' = CACHE ); $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions); Zend_Translate::setCache($cache); $options = array('scan' = Zend_Translate::LOCALE_DIRECTORY); $translate = new Zend_Translate('csv', 'languages', 'auto', $options); if ($translate-isAvailable($locale-getLanguage()) != 1) { $locale-setLocale('en'); } $translate-setLocale($locale-getLanguage()); setcookie('lang', $locale-getLanguage(), null, '/'); Zend_Registry::set('locale', $locale-getLanguage()); Zend_Registry::set('Zend_Translate', $translate); } } The other interesting thing to note is that in my cache directory with 1.6.3 I get two files, but with the PR I get loads! One for each lang file and one for each file under my CVS directory (repository, entries, root etc). I had a look at the docs online and there was some mention of Zend Locale compatibility mode which I have set to false, but still no luck. Any pointers? Cheers, - Robert This email has been scanned for all known viruses by the MessageLabs Email Security Service and the Macro 4 plc internal virus protection system.
[fw-general] xforms with zend
i have a webpage made of xforms. i hope use a database to verify user's name and password before he can fill the form. I plann to use zend frameowrk to do this. I already implemented user authentication. My question is how to let zend to show xforms and received form contents. Do i need to put xforms and .phtml files together? -- View this message in context: http://www.nabble.com/xforms-with-zend-tp20586905p20586905.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Custom validator is not run when the element value is not set
Hi, I have written a custom validator to make either first name or last name field in my form mandatory. But not both. I have added the custom validator to the lastName element. The validator won't run unless the element value is set. I want it to run even though no value is supplied to the element. Is it possible? Here's the relevant part of the form: [snip] $form = new Zend_Form; $firstName = $form-createElement('text', 'firstName') -addValidator(new Zend_Validate_StringLength(0, 100)) -setLabel('First Name'); $middleName = $form-createElement('text', 'middleName') -addValidator(new Zend_Validate_StringLength(0, 100)) -setLabel('Middle Name'); $lastName = $form-createElement('text', 'lastName') -addValidator(new Zend_Validate_StringLength(0, 100)) -setLabel('Last Name') -addValidator(new BV_Validate_PersonName); [/snip] Here's the code in BV_Validate_PersonName [snip] class BV_Validate_PersonName extends Zend_Validate_Abstract { const MSG = 'failed'; protected $_messageTemplates = array( self::MSG = 'Either first name or last name must be supplied', ); public function isValid($value, $context = null) { $this-_setValue($value); if (is_array($context)) { if ( (strlen($context['firstName']) 1) or (strlen($context['lastName']) 1)) { return true; } } $this-_error(self::MSG); return false; } } [/snip] Regards, -- With warm regards, Sudheer. S Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, Personal: http://sudheer.net
Re: [fw-general] Custom validator is not run when the element value is not set
Sudheer wrote: Hi, I have written a custom validator to make either first name or last name field in my form mandatory. But not both. I have added the custom validator to the lastName element. The validator won't run unless the element value is set. I want it to run even though no value is supplied to the element. Is it possible? Never mind. Just re-read the manual and solved the issue by using setAllowEmpty(false). Regards, -- With warm regards, Sudheer. S Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, Personal: http://sudheer.net
Re: [fw-general] [Zend_Paginator] Bug when using complex Zend_Db_Select
I see. :-) Thank you very much for your answers. This conversation was very helpful. Iulian Matthew Ratzloff wrote: That's how it originally worked. There were reasons that it changed. -Matt On Tue, Nov 18, 2008 at 11:26 PM, Iulian M [EMAIL PROTECTED] wrote: Yes, but it should be noted that it will not accept ANY Zend_Db_Select object. The object passed to the setRowCount() must contain the ROW_COUNT_COLUMN = 'zend_paginator_row_count', or else it will throw an exception. In my opinion count function, that actually performs the count operation, should wrap the Zend_Db_Select object that is passed to the Zend_Paginator_Adapter_DbSelect with a select statement like : SELECT count(*) as count from ( ...pased select) as select; Matthew Ratzloff wrote: I just want to be clear that setRowCount() accepts either an integer or Zend_Db_Select object for the TOTAL row count. -Matt On Tue, Nov 18, 2008 at 12:06 PM, Iulian M [EMAIL PROTECTED] wrote: Thank you for your answer. I will consider the situation in which i will pass the calculated rowCount. Iulian Matthew Ratzloff wrote: The easiest way to solve this is to pass in your own Zend_Db_Select COUNT query to Zend_Paginator_Adapter_DbSelect::setRowCount(). http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Paginator/Adapter/DbSelect.php Hope that helps, -Matt On Tue, Nov 18, 2008 at 7:32 AM, Iulian M [EMAIL PROTECTED] wrote: I am creating a Zend_Db_Select statement for this SQL : SELECT table1.a AS a table1.b AS b COUNT(table2.a) -1 as c FROM table1 INNER JOIN table2 ON table1.a = table2.a HAVING c = 1 The select is tested and it worked as expected. The Zend_Db_Select will be used to paginate the result using Zend_Paginator_Adapter_DbSelect. Problem: When Zend_Paginator_Adapter_DbSelect::count() method is executed, to determine the total number of rows that the select will return, an error will be thrown: [message:protected] = SQLSTATE[42S22]: Column not found: 1054 Unknown column 'c' in 'having clause' This is caused by Zend_Db_Select::setRowCount() that creates an special select based on the select defined in Zend_Paginator_Adapter_DbSelect. setRowCount() alters the columns that will be used to run the select and when the fetch is issued the above error will be thrown. -- View this message in context: http://www.nabble.com/-Zend_Paginator--Bug-when-using-complex-Zend_Db_Select-tp20561842p20561842.html Sent from the Zend Framework mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/-Zend_Paginator--Bug-when-using-complex-Zend_Db_Select-tp20561842p20567204.html Sent from the Zend Framework mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/-Zend_Paginator--Bug-when-using-complex-Zend_Db_Select-tp20561842p20574556.html Sent from the Zend Framework mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/-Zend_Paginator--Bug-when-using-complex-Zend_Db_Select-tp20561842p20588505.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] xforms with zend
Assuming you're using something like FormFaces or Ubiquity XForms on the front end, you should be able to treat your forms like regular forms. -Matt On Wed, Nov 19, 2008 at 11:07 AM, nolnor [EMAIL PROTECTED] wrote: i have a webpage made of xforms. i hope use a database to verify user's name and password before he can fill the form. I plann to use zend frameowrk to do this. I already implemented user authentication. My question is how to let zend to show xforms and received form contents. Do i need to put xforms and .phtml files together? -- View this message in context: http://www.nabble.com/xforms-with-zend-tp20586905p20586905.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] xforms with zend
Assuming you're using something like FormFaces or Ubiquity XForms on the front end, you should be able to treat your forms like regular forms. -Matt thanks,but,there is no other solution than this, is there? I mean not to add extra xforms processor. -- View this message in context: http://www.nabble.com/xforms-with-zend-tp20586905p20590734.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Using Zend_Amf with DOMDocument
I created a ticket for this issue and will get it updated right away. http://framework.zend.com/issues/browse/ZF-4999 ZF-4999 Wade -- View this message in context: http://www.nabble.com/Using-Zend_Amf-with-DOMDocument-tp20482637p20592280.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] $cache-start() and caching with Zend_Translate together, possible bug?
Hi ZF people. I have following lines in bootstrap with ZF v1.7 running on php 5.2.6: $cache = Zend_Cache::factory('Page', 'File', array( 'lifetime' = 60 * 60 * 12, 'regexps' = array( // cache whole indexController '^' . BASE_PATH . '$' = array( 'cache' = true), // cache whole indexController '^' . BASE_PATH . 'index' = array( 'cache' = true), // cache whole iController '^' . BASE_PATH . 'i/' = array( 'cache' = true), // cache ajax/get-suggest '^' . BASE_PATH . 'ajax/get-suggest' = array( 'cache' = true, 'cache_with_get_variables' = true, 'cache_with_session_variables' = true, 'cache_with_cookie_variables' = true, 'make_id_with_get_variables' = true, 'make_id_with_session_variables' = false, 'make_id_with_cookie_variables' = false))), array( 'cache_dir' = TEMP_DIR)); $cache-start(); // ... more later Zend_Translate::setCache($cache); $translate = new Zend_Translate('csv', DOC_ROOT . 'language' . DS . 'tr_TR.csv', 'tr_TR'); Zend_Registry::set('Zend_Translate', $translate); And it produces following errors: Warning: unserialize() expects parameter 1 to be string, array given in ...\Zend\Translate\Adapter.php on line 436 Notice: No translation for the language 'tr_TR' available. in ...\Zend\Translate\Adapter.php on line 307 Notice: No translation for the language 'tr_TR' available. in ...\Zend\Translate\Adapter.php on line 307 Notice: No translation for the language 'tr_TR' available. in ...\Zend\Translate\Adapter.php on line 307 When I comment one of the cache feature, either $cache-start() or Zend_Translate::setCache($cache); everything looks fine. I have found similar bug below link but it says it is fixed already: http://framework.zend.com/issues/browse/ZF-3930 Could be a bug?
[fw-general] How to run an action internally
Hello, Is it possible to run an action within an action? Let's say I have two controllers each with one action (foo and bar). If the user is at controller1/foo and I would like to run controller2/boo from within foo, how would I do that? Do I need to create my own request object and push a new action to the action stack? Thanks! -- View this message in context: http://www.nabble.com/How-to-run-an-action-internally-tp20595526p20595526.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_DOM and AJAX
Thanks alot, for providing such an informative reply. Actually I'm very new to ZF, and getting so many problems in finiding any good working example of Zend_Dojo in combination with AJAX. Would you please suggest me any good and descriptive example which can help a beginner like me to start good hands on it. Thanks Ilyas Matthew Weier O'Phinney-3 wrote: -- edgelogix [EMAIL PROTECTED] wrote (on Tuesday, 18 November 2008, 05:45 AM -0800): I've just designed the UI for the application, here I got a question about the forms. I want to use AJAX and DOM, so what is the recommendations about that , how and what is the is most appropriate way to accomplish both of the things. I guess Zend_Dom and also kindly let me know is the Dojo right choice to add here. Thanks Zend_Dom is simply a way to query DOM structures using either CSS query selectors or XPath. It was developed to aid testing, and is being used by many for screen scraping. It has absolutely no relation to Ajax. As for Ajax and dynamic user interfaces, the supported solution by Zend Framework is Zend_Dojo; we ship Dojo with the full distribution, and Zend_Dojo provides the means for integrating with it -- via view helpers, Zend_Dojo_Form, Zend_Dojo_Data, and Zend_Json_Server. Additionally, as of yesterday's 1.7.0 release, we now have ZendX_JQuery in the extras package, which provides jquery integration (though we do not ship jquery with ZF). -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/Zend_DOM-and-AJAX-tp20559881p20595780.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] $cache-start() and caching with Zend_Translate together, possible bug?
Sorry, but on the first look this seems to be a cache problem and not a translation one. Looking at the lines you provide I see that at line 435 the cache is loaded... $result = self::$_cache-load($id); which happens without problems. And then the cache is unserialized. unserialize($result); All translate classes are serializing the data before writing to cache so this can not be a problem. In my opinion there are only 4 things which can corrupt this behaviour. 1.) You are using an outdated cache after an update of ZF 2.) Someone writes manually to the translation cache without serializing the data 3.) Someone uses own written adapter which corrupt the cache 4.) You have a corrupted ZF version... try a update to fix the broken files Of course it could be that there is a problem in Zend_Cache itself, but I dont believe this, because your problem is thrown in unserialize. Why should Zend_Cache change the stored data. And Zend_Translate stores only serialized strings. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: kirpit [EMAIL PROTECTED] To: fw-general@lists.zend.com Sent: Thursday, November 20, 2008 5:41 AM Subject: [fw-general] $cache-start() and caching with Zend_Translate together, possible bug? Hi ZF people. I have following lines in bootstrap with ZF v1.7 running on php 5.2.6: $cache = Zend_Cache::factory('Page', 'File', array( 'lifetime' = 60 * 60 * 12, 'regexps' = array( // cache whole indexController '^' . BASE_PATH . '$' = array( 'cache' = true), // cache whole indexController '^' . BASE_PATH . 'index' = array( 'cache' = true), // cache whole iController '^' . BASE_PATH . 'i/' = array( 'cache' = true), // cache ajax/get-suggest '^' . BASE_PATH . 'ajax/get-suggest' = array( 'cache' = true, 'cache_with_get_variables' = true, 'cache_with_session_variables' = true, 'cache_with_cookie_variables' = true, 'make_id_with_get_variables' = true, 'make_id_with_session_variables' = false, 'make_id_with_cookie_variables' = false))), array( 'cache_dir' = TEMP_DIR)); $cache-start(); // ... more later Zend_Translate::setCache($cache); $translate = new Zend_Translate('csv', DOC_ROOT . 'language' . DS . 'tr_TR.csv', 'tr_TR'); Zend_Registry::set('Zend_Translate', $translate); And it produces following errors: Warning: unserialize() expects parameter 1 to be string, array given in ...\Zend\Translate\Adapter.php on line 436 Notice: No translation for the language 'tr_TR' available. in ...\Zend\Translate\Adapter.php on line 307 Notice: No translation for the language 'tr_TR' available. in ...\Zend\Translate\Adapter.php on line 307 Notice: No translation for the language 'tr_TR' available. in ...\Zend\Translate\Adapter.php on line 307 When I comment one of the cache feature, either $cache-start() or Zend_Translate::setCache($cache); everything looks fine. I have found similar bug below link but it says it is fixed already: http://framework.zend.com/issues/browse/ZF-3930 Could be a bug?
Re: [fw-general] zend dojo text area- how that work?
Try: $textarea_element-addDecorator('HtmlTag', array('tag' = 'div')); This place a div tag instead a dd tag. Works. vladimirn wrote: I need just a simple text area where you can type : First row in text area (i would like to press Enter here and to type in next row) Next row here[Enter] And so on.. Well when i press Enter key within Zend Dojo textarea field, nothing happens, and you can type forever, no way to make a new row pressing Enter.. I cant find the way to have a simple textarea field. How to make this? Thanks, V -- View this message in context: http://www.nabble.com/zend-dojo-text-area--how-that-work--tp19498776p20596217.html Sent from the Zend Framework mailing list archive at Nabble.com.