Re: [fw-general] Models as Singletons

2009-07-21 Thread Peter Warnock
On Tue, Jul 21, 2009 at 10:53 AM, Marko Korhonen < marko.korho...@datafisher.com> wrote: > > Thanks fo everybody for the great comments! > > I decided to change my getInstance() method so it just > created new instance of the class and returns it (giving up on singleton > on this case). > > So if

Re: [fw-general] params problem

2009-07-23 Thread Peter Warnock
You have a hyphen in the request param and an underscore in the arg passed to forward - pw On Jul 23, 2009 2:16 AM, "debussy007" wrote: Hello, I was expecting that if I forward to another action, the parameters specified in the forward() method would override params with same name of the reque

Re: [fw-general] namespace persistence

2009-07-24 Thread Peter Warnock
On Fri, Jul 24, 2009 at 4:24 PM, hacheb wrote: > > What I want, however, is to keep the second namespace. In effect, only the > zend_auth namespace should be unset (ie. removed from the data column) > whilst the other would remain untouched. > I viewed the source for Zend/Session/Namespace.php

Re: [fw-general] hosting suggestions with support for ZF

2009-07-25 Thread Peter Warnock
Explicit Zend Framework support is probably the least important requirement since its very portable. Look for a host that has good up-time, responsive support, and can scale. You can overcome some of the latency issues by using a content delivery network (CDN) to host your static assets. I don't

Re: [fw-general] Seperate action to proccess a form

2009-07-26 Thread Peter Warnock
On Sun, Jul 26, 2009 at 8:36 PM, aSecondWill wrote: > If the form dosn't validate, how do i display the original page, with the > form errors etc. _forward back to the original action and make sure you are accessing the same instance of the form object, it contains the error stack after calling

Re: [fw-general] How render Zend_Form to html table?

2009-08-01 Thread Peter Warnock
You can create a custom decorator or access the elements as properties. - pw On Aug 1, 2009 8:23 AM, "Mark Maynereid" wrote: I've heard this about tables to be avoided in forms, but then how do I mimic SquirrelMail's message list approach (see image below) where I want a table of some data prim

[fw-general] form.elementFilters conflicts with form.elements.options.filters

2009-08-04 Thread Peter Warnock
If I try to run these two filters, only trim works: form.elementFilters.trim = "StringTrim" form.elements.phone.options.filters.digits = "Digits" If I comment out trim, the digits filter works: ;form.elementFilters.trim = "StringTrim" form.elements.phone.options.filters.digits = "Digits" Without

Re: [fw-general] routing question (hostname chain)

2009-08-04 Thread Peter Warnock
2009/8/3 Vladas Diržys > > The problem is then I do such like this: > $hostRoute->chain($pathRoute); -- only one hostname can be routed. > You should have two hostname routes with paths chained to them. The hostname routes will define your modules, while the paths define the controllers. - pw

Re: [fw-general] Best way to have custom URL's for each web page ?

2009-08-08 Thread Peter Warnock
You can create a custom route implementing the interface, or create a plugin, or use a forward after the lookup from the default action. - pw On Aug 8, 2009 12:08 PM, "debussy007" wrote: Hi, I'm building a CMS and I want to allow the users to configure for each page and language a personnalize

Re: [fw-general] Zend_Session Garbage Collections Works?

2009-08-10 Thread Peter Warnock
On Mon, Aug 10, 2009 at 11:20 AM, Alex wrote: > > As an aside: would using the DbTable save handler be more efficient than > the file handler? > > - Alex > The file handler is faster, but the db handler can provide persistence across multiple servers and is potentially more secure depending on t

Re: [fw-general] Zend Framework 2.0

2009-08-12 Thread Peter Warnock
Rackspace supports a custom build of 5.2 on RHEL. On Aug 11, 2009 10:39 AM, "Michael Kimsal" wrote: While distro/php versions probably will always be a factor to some degree, putting too much weight on that as a deciding factor will lead to stagnation. RHEL and CentOS, arguably the most 'enterp

Re: [fw-general] Zend_Form - Adding CSS classnames to multiCheckbox inputs

2009-08-13 Thread Peter Warnock
On Tue, Aug 11, 2009 at 11:07 AM, Hector Virgen wrote: > > > I am building a form that uses the multiCheckbox form element. I need to > add class names to specific checkboxes for javascript purposes. Is there a > way to do that? > > -- > Hector > Why not navigate the dom with javascript? jQuery

Re: [fw-general] 8 custom routers ... should I worry about performance ?

2009-08-13 Thread Peter Warnock
On Thu, Aug 13, 2009 at 1:32 AM, debussy007 wrote: > > In that case one must update the doc: > * > The following route more-or-less mimics the Module route behavior: > $route = new Zend_Controller_Router_Route( >':module/:controller/:action/*', >array('module' => 'default') > ); > $ro

Re: [fw-general] Using Zend Layout for module not main application

2009-09-05 Thread Peter Warnock
In a 1-off scenario, I prefer method 3. No config necessary. Zend_Layout::startMvc(); $this->_helper->layout->setLayout('foobaz'); - pw On Fri, Sep 4, 2009 at 10:02 AM, Matthew Lurz wrote: > > A couple of additional ways... > > 3) Add the layout setup code to the controller init method. > >

Re: [fw-general] Using Zend keeping url intact

2009-09-06 Thread Peter Warnock
route = "(.+)(?:\.php)?" On Tue, Sep 1, 2009 at 5:20 AM, Naimesh.Trivedi (Gmail) < naimesh.triv...@gmail.com> wrote: > Hello ! > > > > Can anybody help me telling, how to keep the URL intact for the working > websites but still to convert them in Zend Framework 1.9. The old sites URLs > are like

Re: [fw-general] Correct model use to gather data from multiple tables

2009-09-12 Thread Peter Warnock
http://framework.zend.com/manual/en/zend.db.table.relationships.html#zend.db.table.relationships.fetching.dependent On Sat, Sep 12, 2009 at 6:31 PM, Er Galvao Abbott wrote: > Greetings. > > I have this basic question for quite some time now and it's incredibly hard > to find examples that explai

Re: [fw-general] Clarification needed about "Zend" and its products

2009-09-12 Thread Peter Warnock
I prefer Zend Framework because it has a large and active community, corporate contributions from Google, IBM, Adobe, StrikeIron, et al, quick iterations, and a solid object-oriented design patterns. I was into Symfony until Fabien and Francois had their falling out. Now it seems like the project

Re: [fw-general] How to get session namespace value

2009-09-12 Thread Peter Warnock
The init method is a good solution, but I had to take it one step farther and register it in the Zend_Registry collection. I was using an action helper and discovered that I had instantiated two different objects. While I was adding data in the action, the action helper did not realize the addition

Re: [fw-general] Zend_Validate_NotEmpty and null values

2009-09-12 Thread Peter Warnock
Based on your example, it looks like the backward compatibility was broken. - pw On Sat, Sep 12, 2009 at 7:20 AM, Martin Carpentier < carpentier.mar...@gmail.com> wrote: > Hi, > > I made a previous > post

Re: [fw-general] Usage of ZFW / PHP in yuor country

2009-09-12 Thread Peter Warnock
If you want an unbiased answer, you're asking the wrong crowd. Of course it is widely, well accepted to use Zend Framework in the enterprise ;) - pw On Sat, Sep 12, 2009 at 3:42 AM, howard chen wrote: > Hello, > > I am from Taiwan. > > In Taiwan, PHP is still not a main stream commerical progra

Re: [fw-general] Zend_Db_Table Application Error

2009-09-13 Thread Peter Warnock
1. Where's the error? 2. You shouldn't use 'require' to load a class. Use the autoloader or 'require_once' 3. If you're using the autoloader, have you added the 'Default' namespace? Is your class in the application models/DbTable directory? - pw On Sun, Sep 13, 2009 at 6:22 AM, Ste

Re: [fw-general] How to set either Zend_Form_Element_Text required?

2009-09-29 Thread Peter Warnock
A custom validator is probably the best way. You can also remove a validator before you call isValid. - pw On Tue, Sep 29, 2009 at 9:48 PM, Leon_L wrote: > > Hi, I'm new to Zend Framework, I have a question is that if I have two > Zend_Form_Element_Text in a form, and I want make either of them

Re: [fw-general] How do you put Zend_Log into bootstrap correctly? - 2

2009-09-29 Thread Peter Warnock
In your example, the logger follows the return, which will never execute. The logger should be in a distinct _init method. Clean up the tabs and get rid of the backslashes. - pw On Tue, Sep 29, 2009 at 11:38 AM, W Itch < im.allergic.2.mailing.li...@gmail.com> wrote: > How do you put Zend_Log in

Re: [fw-general] Caching complex forms

2009-09-29 Thread Peter Warnock
I would only cache if it's visibly slow, or you're running out of memory. If you're going to cache, cache the output since most of the overhead is used in rendering. Keep in mind, you lose the ability to pre-populate the form. - pw On Mon, Sep 28, 2009 at 4:49 AM, holografix . wrote: > > Hi > >

Re: [fw-general] Zend_View adapters

2009-10-23 Thread Peter Warnock
On Fri, Oct 23, 2009 at 3:05 AM, umpirsky wrote: > > So I wonder, are there any plans for implementing some adapterts for > smarty, > savant...? Or will twig adapter get it's place in zf some day? > > If yes, will they have all features which Zend_View has? Because it looks > like Zend_View is a

Re: [fw-general] How to make a global Zend_Log with Zend_Application_Bootstrap

2009-10-23 Thread Peter Warnock
On Sun, Oct 11, 2009 at 5:02 AM, Pádraic Brady wrote: > > You can initialise the Zend_Log instance from a method on the bootstrap > called _initLog(), and return it from that method (essential). Then all you > need to do from any action to get the object is > $this->getInvokeArg('bootstrap')->getR

Re: [fw-general] Route chains not matching URLs with all optional variables

2009-10-24 Thread Peter Warnock
A chain is a single route made up of multiple routes. To achieve what you want, add both the route and the chain to the router and test the route method. - pw On Thu, Oct 22, 2009 at 10:55 AM, Tim Fountain wrote: > I've having some trouble with route chains when the last route in the chain > con

Re: [fw-general] Zend_Form and arrays

2009-10-24 Thread Peter Warnock
2009/10/22 Krzysztof Szatanik > > As you can see even if i get form values in request as i wanted, they > aren't recognized by Zend_Form. Output of $form->getValues() is different > from expected, and even fields aren't recognized, so i can use Zend_Form > only to generate HTML form but not to fil

Re: [fw-general] Router Help?

2009-11-02 Thread Peter Warnock
On Mon, Nov 2, 2009 at 6:36 AM, Tom Printy wrote: Hello, > > I got my route to work however If I add two routes to a controller only > the last one added is evaluated. Is this the intended behavior? > > Do your routes have unique names? - pw

Re: [fw-general] subforms: flattening $form->getMessages in a DRY way

2010-02-08 Thread Peter Warnock
You might look at using a custom error decorator to adapt getMessages to your need. - pw On Mon, Feb 8, 2010 at 9:52 AM, David Mintz wrote: > I am using a Zend_Form containing Zend_Form_Subform instances, and > submitting via jQuery/Ajax, using the AjaxContext helper on the controller > side. Wh

Re: [fw-general] 301 redirects after changing routes

2010-07-21 Thread Peter Warnock
On Tue, Jul 20, 2010 at 5:51 PM, Саша Стаменковић > wrote: > > $this->_redirect('/new-url', array('code' => 301)); > > On Wed, Jul 21, 2010 at 7:54 PM, Jean-Michel Philippon-Nadeau < > j...@jmpnadeau.ca> wrote: > I was hoping there were a config I could add to my routes.ini to catch > requests

Re: [fw-general] Re: Zend_Rest_Client posted XML

2010-07-21 Thread Peter Warnock
Use Zend_Http_Client and call setRawData passing in an xml string. You can use DOMDocument or SimpleXML to create the string. - pw On Sun, Jul 11, 2010 at 1:05 AM, rooboy wrote: > > Hi Will. Did you work out how to post the XML for insert/update > operations? > I am working on similar function

Re: [fw-general] Zend_Form and custom validation workaround

2010-07-21 Thread Peter Warnock
Create subforms to take advantage of array notation and have the validator compare the pair by naming convention. - pw On Thu, Jul 1, 2010 at 10:00 AM, milesap wrote: > > I have a problem that I cannot seem to wrap my head around. > > 3 text fields on my form are "start dates", and another 3 tex

Re: [fw-general] Service Layer, domain objects, mapers and approaches

2011-02-24 Thread Peter Warnock
On Feb 23, 2011, at 8:09 AM, Serkan Temizel wrote: > > > More importantly I need your opinions about this approach. Why ZF don't ship > with a service layer or default mapper? Are they really needed or they just > increase the complexity? > Once you understand the patterns, they actually decrea

Re: [fw-general] Using Zend_Paginator with raw SQL

2011-07-08 Thread Peter Warnock
On Jul 8, 2011, at 6:02 AM, saiman wrote: > Is there any way using Zend pagiantor with raw SQL query, not using > Zend_Db_Select or Zend_Db_Table_Select. Sometimes I prefer not using > those (Zend_Db_*) Create your own adapter that implements the interface. http://framework.zend.com/manual/en/

Re: [fw-general] Mandrill Transport for Zend_Mail (ZF1 or ZF2)

2013-02-05 Thread Peter Warnock
> Just trying to see if anyone else has gone this route, or what the caveats > might be by using a transport that runs over Zend_Http_Client. Take a look at https://github.com/juriansluiman/SlmMail You might be able to fork it and contribute a Mandrill service. -- List: fw-general@lists.zend.

Re: [fw-general] [ZF1] Error with Zend_Rest_Server when set a class that extends Zend_Db_Table

2013-02-11 Thread Peter Warnock
> This is the code to reproduce this error: > >$this->server = new Zend_Rest_Server(); >$this->server->setClass("ClassName"); // Class "ClassName" will > extends Zend_Db_Table It's not a good idea to use Zend_Db_Table as a service layer; it's a data source pattern designed to kee

Re: [fw-general] AbstractRestfulController and HTML

2013-10-13 Thread Peter Warnock
David, IMHO, XHR has become the predominant way for web apps to execute these additional methods in the browser. If you really want the old behavior using a query param, it looks like you can attach a dispatch listener to the controller with a higher priority and set the action in the RouteMat