Re: [fw-general] Re: Zend_Payment proposal ready for review

2010-09-14 Thread Hector Virgen
I agree, plus not all merchants would require the same constructor and it would be awkward to have different method signatures for each constructor. -- Hector

Re: [fw-general] Re: Zend_Acl and Zend_Auth scenario. Best approach.

2010-09-10 Thread Hector Virgen
of your users regardless of role. You can easily add a role field to the table to keep track of them, and you won't have to duplicate your table structure. -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com

Re: [fw-general] Unit tests and resource loaders.

2010-09-10 Thread Hector Virgen
Zend_Test (an extension of PHPUnit included in ZF) can be used to unit test your controllers. Also take a look at Matthew's blog post: http://weierophinney.net/matthew/archives/182-Testing-Zend-Framework-MVC-Applications.html -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts

Re: [fw-general] Unit tests and resource loaders.

2010-09-10 Thread Hector Virgen
BTW if you need to stub in a mock resource in your bootstrap, you can do this: http://pastie.org/1151031 -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Fri, Sep 10, 2010 at 2:46 PM, Hector Virgen djvir...@gmail.com wrote: Zend_Test

Re: [fw-general] Unit tests and resource loaders.

2010-09-10 Thread Hector Virgen
It depends on your setup. You don't have to create stub resources unless you want to mock the behavior of the resource. -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Fri, Sep 10, 2010 at 3:07 PM, Andrey Korolyov akorol...@gmail.comwrote

Re: [fw-general] Zend Search Lucene Wildcard Problem

2010-09-05 Thread Hector Virgen
If you can provide a simple example that reproduces the problem we can go from there. -- Hector On Sep 5, 2010 6:50 AM, José de Menezes Soares Neto z...@detetive.net wrote: Hi people, I am getting problem with Lucene: 1. Search for best of gives me error, ''At least 3 non-wildcard characters

Re: [fw-general] Re: Quote reserved keywords ?

2010-09-03 Thread Hector Virgen
', $data, $where); -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Fri, Sep 3, 2010 at 6:54 AM, debussy007 debussy...@gmail.com wrote: By the way, with fetchAll I got it working : function getDefaultTypeAppointment($doctorId) { $db

Re: [fw-general] Catch any PHP notice

2010-09-02 Thread Hector Virgen
get unexpected errors. -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Thu, Sep 2, 2010 at 9:47 AM, debussy007 debussy...@gmail.com wrote: Hi, When any exception is thrown, the request is forwarded to an error handler. I would like

Re: [fw-general] Re: Zend_Rest_Client and timeout

2010-08-31 Thread Hector Virgen
The HTTP Client is returned by reference so you don't need to set it in the Rest client after changing it. -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Tue, Aug 31, 2010 at 8:02 AM, caseyw cas...@downlifesroad.com wrote

Re: [fw-general] Re: Guidance on storing passwords securely

2010-08-31 Thread Hector Virgen
($relativeUrl); $this-_helper-redirector-gotoUrl($absoluteUrl); -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Tue, Aug 31, 2010 at 9:58 AM, teccmo tec...@gmail.com wrote: Bill just mentioned https and I am wondering how the URL view helper deals

[fw-general] Sitemap and non-visible pages

2010-08-31 Thread Hector Virgen
in the sitemap but only Home shold appear in the navigation menu. Thanks! -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com

Re: [fw-general] ZF developer tools down

2010-08-31 Thread Hector Virgen
I noticed the API docs for core are down, too. Is this related? http://framework.zend.com/apidoc/core http://framework.zend.com/apidoc/corePrevious versions are still available: http://framework.zend.com/apidoc/1.10/ -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online

[fw-general] Re: Sitemap and non-visible pages

2010-08-31 Thread Hector Virgen
though :) -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Tue, Aug 31, 2010 at 10:57 AM, Hector Virgen djvir...@gmail.com wrote: I'm using ZF 1.8.1. My sitemap config contains visible and non-visible pages. The non-visible pages should

Re: [fw-general] Re: Sitemap and non-visible pages

2010-08-31 Thread Hector Virgen
Thanks Andrew! That would definitely work but for some reason that method isn't in my version of ZF (1.8.1) although it appears in the docs for 1.8: http://framework.zend.com/apidoc/1.8/Zend_View/Helper/Zend_View_Helper_Navigation_HelperAbstract.html#setRenderInvisible -- *Hector Virgen* Sr. Web

Re: [fw-general] Re: Sitemap and non-visible pages

2010-08-31 Thread Hector Virgen
Thanks Andrew. For now I will have to go with my previous solution because the ZF library is pulled in as an external dependency. But I'll keep that method in mind for when we upgrade ZF. -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Tue

Re: [fw-general] can _getParam() get $_POST['bar']['foo'] ?

2010-08-30 Thread Hector Virgen
_getParam() only gets the top-level value, so you'll need to get the full array first. But you can create an action helper that adds that functionality if you need it on a regular basis. -- Hector Virgen Sent from my Droid X On Aug 30, 2010 9:14 AM, David Mintz da...@davidmintz.org wrote: Just

Re: [fw-general] Modular Application

2010-08-30 Thread Hector Virgen
In a modular app there is still just a single application.ini. To add module-specific configurations use this form: foo.resources.resource.key = value Where foo us the module name and resource is the name of the resource to configure such as view or db. -- Hector Virgen Sent from my Droid X

Re: [fw-general] ZF 2 and project structure

2010-08-30 Thread Hector Virgen
I believe fixing the controller class names was planned for 2.0, but I could be wrong. -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Mon, Aug 30, 2010 at 9:34 AM, dbenjamin bd.web...@gmail.com wrote: Hello, I have some question

Re: [fw-general] Modular Application

2010-08-30 Thread Hector Virgen
). As for routes, you'll need to bootstrap the module's routes in order to match them, so you'll need to bootstrap them on every request (regardless if they matched). You can't have your application figure out which module to load and then bootstrap its routes. -- *Hector Virgen* Sr. Web Developer

Re: [fw-general] Re: Guidance on storing passwords securely

2010-08-30 Thread Hector Virgen
How about security by obscurity? If your db table has a field named salt it's too obvious, but if you use a non-changing value from the users table (like signup date) concatenated with some application constant it should add a reasonable level of security. -- Hector Virgen Sent from my Droid X

Re: [fw-general] Re: Guidance on storing passwords securely

2010-08-30 Thread Hector Virgen
Bill, do you have any concerns about hackers recovering the user's original (raw) password to log into their other accounts such as banking? That's where I see the salt coming in as a protective measure -- they would need the db as well as the code to discover the password. -- Hector Virgen Sent

Re: [fw-general] Question

2010-08-28 Thread Hector Virgen
You're right, Matthew. I should have used == and ===. -- Hector Virgen Sent from my Droid X On Aug 28, 2010 9:30 AM, Matthew Weier Oapos;Phinney matt...@zend.com wrote: -- Hector Virgen djvir...@gmail.com wrote (on Thursday, 26 August 2010, 11:11 AM -0700): PHP is a loosely-typed language

Re: [fw-general] problem wiht php scripts/load.mysql.php

2010-08-27 Thread Hector Virgen
parse_ini_file(/configs/application.ini): failed to open stream: No such file or directory Try removing the forward slash before configs or specify an absolute path to the file. -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Fri, Aug

Re: [fw-general] Question

2010-08-26 Thread Hector Virgen
comparison } When testing function return values that may return a number or FALSE, it is best to use strict comparisons: while(false !== ($attribute = $result-fetch_assoc())) { ... } -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Thu

Re: [fw-general] Module Set-up in Application.ini vs Bootstrap.php

2010-08-25 Thread Hector Virgen
That's a custom autoloader resource. Here's the code: http://pastie.org/1115810 -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Wed, Aug 25, 2010 at 11:37 AM, Mike Wright mike.wri...@mailinator.comwrote: Hector Virgen wrote: I have

Re: [fw-general] Module Set-up in Application.ini vs Bootstrap.php

2010-08-24 Thread Hector Virgen
:) -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Tue, Aug 24, 2010 at 8:55 AM, Shane McGovern mcgov...@uoregon.eduwrote: Hi Paul It does seem to be order specific. Which in a way makes sense in terms of dependencies, perhaps. The two lines

Re: [fw-general] Module Set-up in Application.ini vs Bootstrap.php

2010-08-24 Thread Hector Virgen
Oops, yea that's custom... You can remove that line. -- Hector Virgen Sent from my Droid X On Aug 24, 2010 11:44 AM, Shane McGovern mcgov...@uoregon.edu wrote: Hi I couldn't get your example to work I am afraid. I'm using 1.10. Specifically this line: resources.date.timezone = America

Re: [fw-general] Parse error: syntax error, unexpected $end

2010-08-23 Thread Hector Virgen
That usually means a curly brace wasn't closed. -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Mon, Aug 23, 2010 at 11:44 AM, Jigal sanders jigalroe...@gmail.comwrote: Hey Mark, These can be annoying bugs. I have had loads of them

Re: [fw-general] Cannot use object of type Zend_Session_Namespace as array

2010-08-19 Thread Hector Virgen
Sometimes the version of PHP that you use in the browser is different from the one that's executed by the command line. To be sure, place a call to phpinfo() in a php file and run that in your browser. It might be different. -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts

Re: [fw-general] Re: Rendering miscellaneous view scripts from within an action

2010-08-11 Thread Hector Virgen
You could also use a partial. Partials handle the cloning/var-clearing for you. Also, be careful with getViewScript(), because it adds a suffix based on the context. It's .phtml by default, but it could be .ajax.phtml if you're using the AjaxContext action helper. -- Hector Virgen Sent on my

Re: [fw-general] Testing controllers in isolation

2010-08-10 Thread Hector Virgen
is it allows me to stub in my stub posts mapper in my unit tests while letting the controller lazy-load the real one in production. An alternative is to use Zend_Registry, but I find this to be a bit cleaner without the static calls. -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts

Re: [fw-general] default value not taken into account when validating a form

2010-08-10 Thread Hector Virgen
When you view the form on the page, is the nature element's value filled in? Are you calling setDefault() before or after adding the element to the form? -- Hector Virgen Sent on my Droid X On Aug 10, 2010 3:17 PM, Guillaume ORIOL go.li...@technema.fr wrote: Hi, I simply don't understand why I

Re: [fw-general] Problem with Zend_Form_Element_Hash and Ajax

2010-08-10 Thread Hector Virgen
Each time the form is submitted, you should generate a new hash and update the ajax call to use the new hash. Otherwise you're missing out on the benefits of using a hash. -- Hector Virgen Sent on my Droid X On Aug 10, 2010 3:33 PM, João Pinheiro joao.pinhe...@pontosi.pt wrote: Hi, I've

Re: [fw-general] default value not taken into account when validating a form

2010-08-10 Thread Hector Virgen
Is it a hidden input? Try this to see if it helps: $form-getElement('nature')-setValue('consignment'); -- Hector Virgen Sent on my Droid X On Aug 10, 2010 3:38 PM, Guillaume ORIOL go.li...@technema.fr wrote: The nature element is not filled in by the user. And the setDefault() is called after

Re: [fw-general] default value not taken into account when validating a form

2010-08-10 Thread Hector Virgen
string for that field. Btw, why doesn't that element appear in the post data? -- Hector Virgen Sent on my Droid X On Aug 10, 2010 3:50 PM, Guillaume ORIOL go.li...@technema.fr wrote: No, this is not a hidden field. I already tried your suggestion with setValue() but it doesn't help. I was able

Re: [fw-general] Team Development

2010-08-06 Thread Hector Virgen
We have each developer set up their own dev environment on their local machine. At my previous company we shared a dev server and it was a daily occurence that someone would kill dev by running an unoptimized query or infinite loop. But each developer running their own dev instance is not without

Re: [fw-general] Creating tables in template using livedocx

2010-08-02 Thread Hector Virgen
You can use Zend_Debug::dump($var) to inspect the array. It's a wrapper for var_dump(). Once you can see the array structure it should be easy to foreach the values to output table rows. -- Hector Virgen Sent from my Droid X On Aug 2, 2010 6:06 AM, tonystamp tonyst...@hotmail.co.uk wrote

Re: [fw-general] Re: Help with development of high traffic application (replication / media management) with ZF

2010-07-21 Thread Hector Virgen
And don't forget up to 30% performance increase of PHP 5.3: http://schlueters.de/blog/archives/68-PHP-5.3-Up-to-30-performance-win.html -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Wed, Jul 21, 2010 at 9:19 AM, Wil Moore III wil.mo

Re: [fw-general] Re: Zend_Form + Custom Element + PHP 5.3

2010-07-14 Thread Hector Virgen
My mistake, I didn't see that you were using namespaces. I'm not sure if namespaces are supported by the plugin loader, can someone else confirm? -- *Hector Virgen* Sr. Web Developer Walt Disney Parks and Resorts Online http://www.virgentech.com On Wed, Jul 14, 2010 at 4:20 PM, Wil Moore III

Re: [fw-general] Adding POST vlaues to a request

2010-07-09 Thread Hector Virgen
Zend_Controller_Request_Http has a setPost() method that lets you add values. Try this: // Add to existing POST values: $request-setPost('foo', 'bar'); // Replace existing POST values: $request-setPost(array('foo' = 'bar')); -- Hector Virgen On Fri, Jul 9, 2010 at 8:54 AM, debussy007 debussy

Re: [fw-general] Fwd: Module's sub-directory link (beginner Level question)

2010-07-07 Thread Hector Virgen
...@gmail.comwrote: On 7/6/2010 10:04 PM, Hector Virgen wrote: It appears that your application is not using the same version of the Zend Framework as the one that created the project. Normally, that class constant would be defined. To check your ZF version, do a var_dump of Zend_Version::VERSION

Re: [fw-general] Re: How can I print_r or Zend_Debug $formData in my editAction?

2010-07-07 Thread Hector Virgen
You can cheat and write that line in your controller; you should see something on your screen. Since it's just for debugging purposes, and not part of the application, you don't need to jump through the MVC hoops unless you plan on keep that debug line of code in there (in that case, I'd switch to

Re: [fw-general] Forward to custom url

2010-07-07 Thread Hector Virgen
Do you mean redirect? _forward doesn't cause a redirect, it just dispatches a new request internally. For redirects try this from within your controller: return $this-_helper-redirector-gotoRoute($params, [$module,] $route); It uses the same arguments as the url view helper.

Re: [fw-general] Re: Forward to custom url

2010-07-07 Thread Hector Virgen
A forward doesn't change the URL in the browser's address bar. Only redirects can do that. -- Hector On Wed, Jul 7, 2010 at 3:11 PM, debussy007 debussy...@gmail.com wrote: I need a forward, not a redirect. Is there any way ? -- View this message in context:

Re: [fw-general] How can I print_r or Zend_Debug $formData in my editAction?

2010-07-06 Thread Hector Virgen
You're performing a redirect which prevents you from seeing the var_dump'ed data. Try this: Zend_Debug::dump($formData); exit; -- Hector On Tue, Jul 6, 2010 at 8:35 AM, W Itch im.allergic.2.mailing.li...@gmail.com wrote: How can I print_r or Zend_Debug *$formData* in my editAction? I want

Re: [fw-general] Fwd: Module's sub-directory link (beginner Level question)

2010-07-06 Thread Hector Virgen
It appears that your application is not using the same version of the Zend Framework as the one that created the project. Normally, that class constant would be defined. To check your ZF version, do a var_dump of Zend_Version::VERSION. Also, your URLs should not link to .phtml files directly.

Re: [fw-general] Default location for form

2010-07-06 Thread Hector Virgen
I normally place the forms folder alongside controllers, models, and views: `-- application |-- controllers |-- forms |-- models `-- views The same structure is repeated within each module. -- Hector On Tue, Jul 6, 2010 at 9:32 PM, Bagus Nugroho bnugr...@unisemgroup.comwrote:

Re: [fw-general] Re: Active page with Routers

2010-07-02 Thread Hector Virgen
I have not run into this problem and I use a mix of routes (some regex, some static, some mvc). What I noticed has helped is specifying the route default for all navigation pages that use the default route. So your first navigation page would look more like this: $pages = array( array(

Re: [fw-general] Zend_Filter_StripTags question

2010-06-30 Thread Hector Virgen
Generally, any data coming from the user should be treated as dirty, unsanitary, and filthy. You can even go so far as to assume it has cooties. With that in mind, it's always a good idea to filter incoming data. If you're expecting a number (such as page number), cast it to int. If you're

Re: [fw-general] Re: Translating urls

2010-06-30 Thread Hector Virgen
If the default route isn't working for you, your best bet is probably to define a new default route. -- Hector On Wed, Jun 30, 2010 at 4:58 AM, umpirsky umpir...@gmail.com wrote: I'm still looking for solution, can anyone help? -- View this message in context:

Re: [fw-general] Zend_Auth: Manually setting one identity

2010-06-23 Thread Hector Virgen
So you're saying an admin goes to the login page, enters a user's username (ex. johndoe) and the god mode password (ex. g0dm0d3), your application should log him in as that user? In that case, I would check the password field first -- if it matches the god mode password, you can inject the

Re: [fw-general] Accessing models from view helpers

2010-06-09 Thread Hector Virgen
Hi Aurimas, That's my blog post, and using an identity map definitely can improve performance, especially when you need to fetch the same object multiple times in a request. For example, if PHP is generating a page with 20 comments and 10 of them are by the same person, you don't want to make a

Re: [fw-general] What is difference between Action Helper and Plugin

2010-06-03 Thread Hector Virgen
Unless you need to interact with the actual controller object, I'd go with a plugin. But sometimes you can have both -- Zend_Layout, for example, has both a plugin and an action helper. -- Hector On Wed, Jun 2, 2010 at 8:08 PM, Enkhbilguun Erdenetsogt enkhbilg...@beregu.com wrote: Hello,

Re: [fw-general] modular app - library

2010-06-03 Thread Hector Virgen
If you're using Zend_Loader_Autoloader you'll need to add the Manager namespace in order for those classes to be autoloaded (or you can enable the fallback autoloader). If you want to enforce that those classes are only used by the manager module, then you should make sure the namespace is added

Re: [fw-general] Re: Saving many Zend_Db_Table_Rows in for loop

2010-05-24 Thread Hector Virgen
If you call the factory method twice with the same parameters, will that create two connections? Саша, is it possible that somewhere in your code you are calling the factory method more than once to connect to your DB? Specifically Zend_Db::factory(). -- Hector On Mon, May 24, 2010 at 9:29 AM,

Re: [fw-general] Re: Saving many Zend_Db_Table_Rows in for loop

2010-05-24 Thread Hector Virgen
, Hector Virgen djvir...@gmail.com wrote: If you call the factory method twice with the same parameters, will that create two connections? Саша, is it possible that somewhere in your code you are calling the factory method more than once to connect to your DB? Specifically Zend_Db::factory

Re: [fw-general] Serving XHTML with the correct mime-type

2010-05-24 Thread Hector Virgen
Andrew, You may want to inform the Doctype view helper of your selected doctype early on in your request (at bootstrap is great) because other view helpers will use it to determine if tags need to be self-closed or not. -- Hector

Re: [fw-general] Quick help with routes

2010-05-24 Thread Hector Virgen
If your min/max price comes in as a single parameter with a hyphen between the two values, you can use explode() to get the individual parts: $price = $this-_request-getParam('price'); $priceParts = explode('-', $price); $priceMin = $priceParts[0]; $priceMax = $priceParts[1]; -- Hector On Mon,

Re: [fw-general] Re: Zend View Helper

2010-05-24 Thread Hector Virgen
Or if you're using Zend_Application you can add this line to your application.ini resources.view.helperPath.Default_View_Helper = APPLICATION_PATH /views/helpers The part Default_View_Helper is your helper classname prefix for all view helpers in that folder. -- Hector On Sun, May 23, 2010 at

[fw-general] Zend_Config and versioning

2010-05-24 Thread Hector Virgen
Hello, We are using a Zend_Config object for Zend_Navigation (as suggested in the docs[1]). We need to version-ize our navigation (1.0, 1.1, 1.2, etc.) in order to meet client needs. Does Zend_Config support versions? If not, is there a way to cleverly emulate versioning support? I know I can

Re: [fw-general] Zend_Config and versioning

2010-05-24 Thread Hector Virgen
and simplest way. Shaun J. Farrell Washington, DC On Mon, May 24, 2010 at 5:53 PM, Hector Virgen djvir...@gmail.com wrote: Hello, We are using a Zend_Config object for Zend_Navigation (as suggested in the docs[1]). We need to version-ize our navigation (1.0, 1.1, 1.2, etc.) in order to meet

Re: [fw-general] Zend_Config and versioning

2010-05-24 Thread Hector Virgen
version of the navigation. Shaun J. Farrell Washington, DC On Mon, May 24, 2010 at 6:17 PM, Hector Virgen djvir...@gmail.com wrote: Thanks Shaun. I agree, separate XML files for each version might be the cleanest way. I wanted to avoid copy/paste but I think for this use case it makes more

Re: [fw-general] Quick help with routes

2010-05-24 Thread Hector Virgen
/%s-%s/year/%s-%s -- Hector On Mon, May 24, 2010 at 3:18 PM, Саша Стаменковић umpir...@gmail.comwrote: Yes, I must explode them manually. Thanks. Regards, Saša Stamenković On Mon, May 24, 2010 at 10:13 PM, Hector Virgen djvir...@gmail.comwrote: If your min/max price comes in as a single

Re: [fw-general] Zend_Config and versioning

2010-05-24 Thread Hector Virgen
? On Monday, May 24, 2010, Hector Virgen djvir...@gmail.com wrote: Hello, We are using a Zend_Config object for Zend_Navigation (as suggested in the docs[1]). We need to version-ize our navigation (1.0, 1.1, 1.2, etc.) in order to meet client needs. Does Zend_Config support versions

Re: [fw-general] ajax + breadcrumbs

2010-05-24 Thread Hector Virgen
I'd be interested to hear what others have to say, but a simple suggestion would be to return the updated breadcrumb in a separate div or json segment. I personally wouldn't use a second ajax request. This might be a good candidate for an action helper to inject the navigation into the response.

Re: [fw-general] pass parameters with contextSwitching

2010-05-23 Thread Hector Virgen
ContextSwitch doesn't support per-context variables, but you can accomplish this using the built-in params. For example, you can use a switch on the format parameter in your list action: $format = $this-_request-getParam('format'); switch ($format) { case 'list': /* ... */

Re: [fw-general] call a function from another module..

2010-05-23 Thread Hector Virgen
You can instantiate a controller like any other class, but you'll need to pass the request and response to the constructor. From there, if your method is public, you should be able to call it no problem. However, I'm not sure if the built-in autoloader is set up to handle controllers. You may

Re: [fw-general] Set script action in frontControllerPlugin::preDispatch()

2010-05-18 Thread Hector Virgen
Maybe an action helper would be better. They also support preDispatch hooks. You will need to bootstrap the helper in order to make sure the hook runs. Zend_Controller_Action_HelperBroker::getStaticHelper('MyActionHelper'); -- Hector On Tue, May 18, 2010 at 12:13 PM, Jurian Sluiman

Re: [fw-general] Zend_Paginator and normalization of pageNumber

2010-05-17 Thread Hector Virgen
I'm not sure if it's useful, but you can get around it by doing a quick test: if ($page $paginator-count()) return null; -- Hector On Mon, May 17, 2010 at 10:54 AM, Bartosz Maciaszek bartosz.macias...@gmail.com wrote: Hi all, I just had a bit of work to do with Zend_Paginator (nb. with

Re: [fw-general] Serving XHTML with the correct mime-type

2010-05-14 Thread Hector Virgen
I suggest using the response object for outputting headers instead of doing that in index.php. You might run into issues later when you try to set cookies or start the session if headers have already been sent. To use the response object, you can use a front controller plugin to manipulate the

Re: [fw-general] Serving XHTML with the correct mime-type

2010-05-14 Thread Hector Virgen
What problem are you having with nbsp;? I didn't realize it's not valid XHTML. Should it be #160; instead? -- Hector On Fri, May 14, 2010 at 11:54 AM, Andrew Ballard aball...@gmail.com wrote: On Fri, May 14, 2010 at 2:27 PM, Hector Virgen djvir...@gmail.com wrote: I suggest using

Re: [fw-general] Formatting localized date time wih Zend_Date

2010-05-14 Thread Hector Virgen
Wow, I didn't know nbsp; existed in 1875! ;) -- Hector On Fri, May 14, 2010 at 3:24 AM, Nicolas Grevet ngre...@alteo.fr wrote: There's a lot of formats in the CLDR that are completely ridiculous. Thanks to the General Conference on Weights and Measures in 1875, French numbers' thousands

Re: [fw-general] ContextSwitch and json problem

2010-05-12 Thread Hector Virgen
You can do this: $this-view-assign($treeNodes-fetchAll()-toArray()); That will take each element of the array and assign them as view variables. -- Hector On Wed, May 12, 2010 at 12:23 AM, shahrzad shahrzad.khorr...@gmail.comwrote: hi all, in index action , I fetch db data and with

Re: [fw-general] Space in URL causing an error

2010-05-12 Thread Hector Virgen
You don't want to urlencode the entire URL because it will encode things like the colon and forward-slash. Instead, you'll need to split up your url into parts and only encode the parts between the forward-slashes (after the domain). An easier way to do this is use the url view helper. It

Re: [fw-general] PHPUunit and includePaths specified in application.ini

2010-05-11 Thread Hector Virgen
By default, ZF won't load a class named Mymodel. You'll need to prefix the class name with Model_ (or Default_Model_ if you are using the module autoloader). -- Hector On Tue, May 11, 2010 at 12:26 PM, afx114 z...@thesnodgrass.com wrote: Hi, In my application.ini, I am specifying

Re: [fw-general] Re: PHPUunit and includePaths specified in application.ini

2010-05-11 Thread Hector Virgen
z...@thesnodgrass.com wrote: Hector Virgen wrote: By default, ZF won't load a class named Mymodel. You'll need to prefix the class name with Model_ (or Default_Model_ if you are using the module autoloader). Thanks Hector, but that is not my problem. It works if I manually add my

Re: [fw-general] PHPUnit and using tearDown() on Resource Plugins

2010-05-10 Thread Hector Virgen
It looks like require() is being called on the filename somewhere (instead of require_once()). Do you have xdebug? A backtrace might help find it. -- Hector On Mon, May 10, 2010 at 5:23 PM, afx114 z...@thesnodgrass.com wrote: Hi, I have some unit testing set up and working fine. However,

Re: [fw-general] Re: PHPUnit and using tearDown() on Resource Plugins

2010-05-10 Thread Hector Virgen
I could be wrong, but I think your default autoloader is pretty much what ZF's default autoloader does. Have you tried using the built-in one? You might want to specify each namespace you want to use (the default is to only load Zend_* classes) or enable all namespaces with

Re: [fw-general] Model, data source, data mapper and service layer

2010-05-07 Thread Hector Virgen
. Does this mean that the database isn't actually queried until you iterate over the ArticleCollection? Is there a code example for this that I could examine? Thanks, -- Mon On Fri, Apr 16, 2010 at 1:41 AM, Hector Virgen djvir...@gmail.com wrote: I would pass in the criteria as array

Re: [fw-general] PHPUnit taking forever?

2010-05-06 Thread Hector Virgen
Do your unit tests set up a database connection? That's usually one of the things that can slow down tests. Also, how many tests are you running? Are certain tests faster than others? -- Hector On Thu, May 6, 2010 at 3:59 PM, Brian Caspe bca...@gmail.com wrote: Hi, I've just set up PHPUnit

Re: [fw-general] PHPUnit taking forever?

2010-05-06 Thread Hector Virgen
that? I'm just running 2 or 3 tests, so it's something in the way that phpunit runs. I should probably test phpunit with a straightforward test instead of trying to bootstrap the application to make sure that it runs quickly. Brian On Fri, May 7, 2010 at 1:13 AM, Hector Virgen djvir...@gmail.com

Re: [fw-general] FlashMessenger and i18n

2010-04-30 Thread Hector Virgen
You can manually translate your messages after pulling them out of the flash messenger. -- Hector On Fri, Apr 30, 2010 at 8:53 AM, Guillaume ORIOL go.li...@technema.frwrote: Hi, Is there any plan to make the FlashMessenger action helper compatible with Zend_Translate? Best regards --

Re: [fw-general] FlashMessenger and i18n

2010-04-30 Thread Hector Virgen
. -- Guillaume Le 30/04/10 18:03, Hector Virgen a écrit : You can manually translate your messages after pulling them out of the flash messenger. -- Hector On Fri, Apr 30, 2010 at 8:53 AM, Guillaume ORIOL go.li...@technema.fr mailto:go.li...@technema.fr wrote: Hi, Is there any plan

Re: [fw-general] Re: Session Db trouble with ajax request without event handleri

2010-04-29 Thread Hector Virgen
Are your sessions not working at all, or do they only break when on XHR requests? -- Hector On Thu, Apr 29, 2010 at 7:39 AM, whisher whis...@mp4.it wrote: It works with a table like CREATE TABLE `tn_session` ( `id` char(32), `modified` int, `lifetime` int, `data` text, PRIMARY KEY

Re: [fw-general] Re: Session Db trouble with ajax request without event handleri

2010-04-29 Thread Hector Virgen
I don't understand. There's nothing special about an XHR request that would kill the session. In fact, I use XHR all the time with various session backends and have never had a problem that resulted from XHR alone. There must be something else going on, perhaps in your controller or custom plugins

Re: [fw-general] Re: Session Db trouble with ajax request without event handleri

2010-04-29 Thread Hector Virgen
A couple of things I would test to see what might be going on: 1) Verify that the session has been started using Zend_Session::start() 2) Verify that the session id is consistent between XHR and non-XHR requests using Zend_Session::getId() 3) Verify that the session data is being written to the

Re: [fw-general] Session Db trouble with ajax request without event handleri

2010-04-28 Thread Hector Virgen
What is tvnVideoApp.sendRequest(1);? Are you using jQuery's built-in $.ajax() to initiate ajax requests? -- Hector On Wed, Apr 28, 2010 at 9:52 AM, whisher whis...@mp4.it wrote: tvnVideoApp.sendRequest(1);

Re: [fw-general] Re: Session Db trouble with ajax request without event handleri

2010-04-28 Thread Hector Virgen
That seems fine to me. So if you change the session storage from Db to File, it works? Are any other settings changed? -- Hector On Wed, Apr 28, 2010 at 10:00 AM, whisher whis...@mp4.it wrote: Yes, I'm using Jquery. Like tvnVideoApp.sendRequest = function(page) { $.ajax({ type:

Re: [fw-general] Re: Display Group -- Help

2010-04-26 Thread Hector Virgen
You might be better off creating a composite element. Check out Matthew's blog post (his example just happens to be a date of birth element): weierophinney.net/matthew/archives/217-Creating-composite-elements.html -- Hector On Mon, Apr 26, 2010 at 7:17 AM, raj todkari

Re: [fw-general] Zend_Form composite time element

2010-04-26 Thread Hector Virgen
I followed his tutorial to create my own date composite element, but I wanted to use selects instead of text fields. I added 3 new methods to the element that returns the multiOptions for each of the selects: My_Form_Element_Date#getMonthMultiOptions() My_Form_Element_Date#getDayMultiOptions()

Re: [fw-general] Forward/Attach Zend_Mail_Message to Zend_Mail instance

2010-04-22 Thread Hector Virgen
Sorry if this isn't a direct answer, but you might want to look at raw data of other emails. For example, if you use gmail, you can view the original message, complete with headers. You should be able to reproduce it from scratch with Zend_Mail. -- Hector On Thu, Apr 22, 2010 at 11:23 AM,

Re: [fw-general] What will happen, when Zend_Cache is filled up?

2010-04-21 Thread Hector Virgen
The nice thing about using a lifetime is that data that hasn't been accessed in a while gets dropped eventually, freeing room for the heavily-accessed stuff. -- Hector On Sun, Apr 18, 2010 at 8:47 AM, Thomas D. whist...@googlemail.com wrote: Ben Scholzen 'DASPRiD' wrote: What do you mean by

Re: [fw-general] Change layout segments content in Plugin

2010-04-16 Thread Hector Virgen
Are you sure that block of code is running? Keep in mind that isset() returns false if the variable *is* set but is set to null. Also, you might be better off injecting some HTML into a placeholder. The FlashMessenger could also be used, but when you pull messages from it you need to check both

Re: [fw-general] Model, data source, data mapper and service layer

2010-04-16 Thread Hector Virgen
at 10:16 AM, Thomas D. whist...@googlemail.com wrote: Hi, Hector Virgen wrote: But how do you deal with other properties? For example, your articles have a isPublished flag. Now you want a list with n articles, which are published (isPublished === 1), ordered by another property

Re: [fw-general] Model, data source, data mapper and service layer

2010-04-16 Thread Hector Virgen
Lazy-loading sounds good, but wouldn't it be better, if your fetchAll() method would fetch every row matching your criteria and cache the data? No need to instantiate each object in your result set, when you are just preparing the set, this can still happen in your collection... or are you

Re: [fw-general] Model, data source, data mapper and service layer

2010-04-15 Thread Hector Virgen
We are taking a different approach that works well for us. When you look at methods like these: fetchLatestArticles() fetchArticlesBasedOnCategory($category) fetchBlueArticlesByOrderedByGermanyPaidLastMonth() They all have two things in common: they return articles and they rely on criteria.

Re: [fw-general] Model, data source, data mapper and service layer

2010-04-15 Thread Hector Virgen
On Thu, Apr 15, 2010 at 10:13 AM, Thomas D. whist...@googlemail.com wrote: Hi, Hector Virgen wrote: We are taking a different approach that works well for us. When you look at methods like these: fetchLatestArticles() fetchArticlesBasedOnCategory($category

Re: [fw-general] Model, data source, data mapper and service layer

2010-04-15 Thread Hector Virgen
On Thu, Apr 15, 2010 at 10:35 AM, Paul z...@zooluserver.com wrote: I think it's more important to concentrate on your domain AND not your data layer first. It's GOOD to have many specialized methods if your business logic works that way and more importantly is described that way. This is a

Re: [fw-general] Model, data source, data mapper and service layer

2010-04-15 Thread Hector Virgen
search forms. -- Hector On Thu, Apr 15, 2010 at 10:58 AM, Hector Virgen djvir...@gmail.com wrote: On Thu, Apr 15, 2010 at 10:35 AM, Paul z...@zooluserver.com wrote: I think it's more important to concentrate on your domain AND not your data layer first. It's GOOD to have many specialized

Re: [fw-general] How to escape double quotes in .ini

2010-04-13 Thread Hector Virgen
Zend_Config internally uses PHP's built-in function parse_ini_file(), which has some limitations such as lack of escaping. But if you are using PHP 5.3, you can use single quotes around the value: something = ' ' -- Hector On Tue, Apr 13, 2010 at 8:14 AM, batykar baty...@gmail.com wrote:

<    1   2   3   4   5   >