[fw-general] zend _helpers vs. static functions

2009-02-16 Thread O'BRIEN, Steven X
Hi All, Just a quick question regarding zend helper classes. Are these more efficient than using standard php object static methods For example in a view script to get the baseUrl. The helper version might look like: $this-baseUrl(); The object static function might look like: App::baseUrl();

Re: [fw-general] zend _helpers vs. static functions

2009-02-16 Thread Karol Grecki
Steven If you mean faster, no they are not. But it's irrelevant, the difference is next to nothing, definitely not worth breaking OO design. If you're looking for optimisations start with http://framework.zend.com/manual/en/performance.html Cheers O'BRIEN, Steven X wrote: Hi All, Just a

Re: [fw-general] User uploads file bigger than what's allowed in php.ini, can it be caught?

2009-02-16 Thread bytte
Bug in my code or bug in Zend Framework? bytte wrote: I'm now using setMaxFileSize(). Here's the (reduced for readability) code in my controller to retrieve and validate the form input. I have two forms on the same page so that's why I do the array_key_exists thing to check which form

[fw-general] Base Controller convienience methods

2009-02-16 Thread Marko Korhonen
Hi all, I'm pretty sure that others have done the same as me: Base Controllers like My_BaseController and used as follows: Module_SomeController extends MyLibrary_Controller_Base Well, if so, you probably have done some methods just to shorten things a bit. I'll share some of my convienience

Re: Re: [fw-general] How to contact the Zend Framework team about OOP bad practices/suggestions?

2009-02-16 Thread Thomas Weidner
Don't forget also to add the unit tests. ;-) This simplifies the things for us reviewers and fastens the integration of this fix into the core. And of course don't forget to ask the person who is actually assigned to this bug... he may already be working on it. ;-) Greetings Thomas Weidner,

Re: [fw-general] Problems with cookies and translations

2009-02-16 Thread Thomas Weidner
How should the translation work when the cookie with the language is not saved ? You should first find the problem why your cookie is not saved. Still you need to have a workaround as many people don't allow to store cookies. Greetings Thomas Weidner, I18N Team Leader, Zend Framework

Re: [fw-general] User uploads file bigger than what's allowed in php.ini, can it be caught?

2009-02-16 Thread Thomas Weidner
Who knows ? ;-) Try so use trunk and see if the problem is still there. Several automatic additions have been applied there (automatic setMaxFileSize, exception on missing decorator, automatic encoding). If your problem is still not solved with trunk add a issue with reproducable code. See the

[fw-general] Zend_Form submit not to have a name

2009-02-16 Thread Joó Ádám
Matthew, Can I somehow get the input buttons not to have a name, therefore not to present among posted values? It would be very nice to just write $table-insert($this-_request-getPost()) rather than creating a new array element-by-element. I tried to use an ampty and a null value for the name

Re: [fw-general] Zend_Form submit not to have a name

2009-02-16 Thread Tobias Gies
Hey Joó, seeing as you do of course validate your form before you insert the data into your table, you can use $table-insert($form-getValues()). This should give you the desired result. Best regards, Tobias 2009/2/16 Joó Ádám cer...@gmail.com: Matthew, Can I somehow get the input buttons not

Re: [fw-general] Form values and paginator question

2009-02-16 Thread Paweł Chuchmała
In mypaginator.phtml, you have something like that: a href=?= $this-url(array('page' = $page)); ? ?= $page; ? /a You must cznge parameters for $this-url(). For example: a href=?= $this-url(array_merge(array('page' = $page), $this-dataForPaginatorUrl)); ? ?= $page; ?

Re: [fw-general] Zend_Form submit not to have a name

2009-02-16 Thread Joó Ádám
Hey Joó, Just Ádám, please (eastern order) seeing as you do of course validate your form before you insert the data into your table, you can use $table-insert($form-getValues()). This should give you the desired result. No, it's still there since it has a name attribute and therefore the

Re: [fw-general] My model does not appear to be working.

2009-02-16 Thread SirEdward
Hi This method is great and what I was after, except that because I am using error_reporting (E_ALL|E_STRICT); I get the following error Strict Standards: Declaration of XXX::fetchAll() should be compatible with that of Zend_Db_Table_Abstract::fetchAll() in

Re: [fw-general] Zend_Form submit not to have a name

2009-02-16 Thread Jason Webster
Here's a favorite trick of mine when I use *_Db_Table: public function insert(array $data) { $data = array_intersect_key($data, array_fill_keys($this-info('cols'), '')); return parent::insert($data); } public function update(array $data, $where) {

Re: [fw-general] Zend_Form submit not to have a name

2009-02-16 Thread mikaelkael
Zend_Db_Table_Row already did it for you: $table = new MyApp_Db_Table; $data = $form-getValues(); $row = $table-createRow($data); $row-save(); // or $row = $table-createRow(); $row-setFromArray($data); $row-save(); Mickael PHPScriptor a écrit : How I deal with this. I

Re: [fw-general] about zend_db_table and cascading deletes

2009-02-16 Thread william0275
Mark Wright-3 wrote: When you use a reference map and dependent tables for cascading row deletion in the dependent tables how are those rows deleted? Does the table class issue a sql delete statement or does it go through the row object? The reason I ask is that I need it to go through

Re: [fw-general] Zend_Form submit not to have a name

2009-02-16 Thread Joó Ádám
Thanks for everyone, especially for Mickael, it works fine! Regards, Ádám

Re: [fw-general] Zend_Form, Validators , Filters, and ini files

2009-02-16 Thread Bob O
Fantastic..That worked..thank you Matthew. my final struggle is this foreach ($this-_campaignCreateForm-getMessages() as $message) { $this-flash((Invalid Data: $message\n), 'error', '/advertiser/create-campaign'); } returns the flash

Re: [fw-general] about zend_db_table and cascading deletes

2009-02-16 Thread PHPScriptor
william0275 wrote: If you call delete() or update() on a Zend_Db_Table, it *won't* use the dependencies/trigger system. Yes, and that's why I think it's useless to use dependencies in Zend. It will only delete one level. e.g category - subcategory - subsubcategory Delete

Re: [fw-general] My model does not appear to be working.

2009-02-16 Thread Brenton Alker
SirEdward wrote: Hi This method is great and what I was after, except that because I am using error_reporting (E_ALL|E_STRICT); I get the following error Strict Standards: Declaration of XXX::fetchAll() should be compatible with that of Zend_Db_Table_Abstract::fetchAll() in

Re: [fw-general] Zend_Form submit not to have a name

2009-02-16 Thread Matthew Weier O'Phinney
-- Joó Ádám cer...@gmail.com wrote (on Monday, 16 February 2009, 06:09 PM +0100): Can I somehow get the input buttons not to have a name, therefore not to present among posted values? It would be very nice to just write $table-insert($this-_request-getPost()) rather than creating a new array

Re: [fw-general] Zend_Form, Validators , Filters, and ini files

2009-02-16 Thread Matthew Weier O'Phinney
-- Bob O b...@electricgraffitti.com wrote (on Monday, 16 February 2009, 12:49 PM -0800): Fantastic..That worked..thank you Matthew. my final struggle is this foreach ($this-_campaignCreateForm-getMessages() as $message) { $this-flash((Invalid Data:

Re: [fw-general] Form values and paginator question

2009-02-16 Thread Deepak Shrestha
2009/2/17 Paweł Chuchmała pawel.chuchm...@gmail.com: In mypaginator.phtml, you have something like that: a href=?= $this-url(array('page' = $page)); ? ?= $page; ? /a You must cznge parameters for $this-url(). For example: a href=?= $this-url(array_merge(array('page' =

[fw-general] What is the fourth parameter of pagination control?

2009-02-16 Thread Deepak Shrestha
Hi, Although related to my previous post on paginator, this is separate from what is being discussed before. Documentation on Zend_Paginator http://framework.zend.com/manual/en/zend.paginator.usage.html (In the last para of 36.2.2. Rendering pages with view scripts) suggests that it accepts four