[fw-general] Actionstack bad, Layout and View Helpers good??

2009-07-14 Thread Sam Davey
Hi, I've been reading a number of articles about why the Action Stack is bad and everything you need to achieve with the action stack could be achieved with ViewHelpers. I completely buy into this... I can't remember the number of times I've had to fudge code because my predispatch hooks are

[fw-general] Create an Excel file from the returned table rows

2009-07-14 Thread jigen7
hi im wondering how will i create an excel files from the returned rows? //Code $table = new Model_Crescores(); $select = $table-select(); $select-order('cap_no'); $array = $table-fetchAll($select); // the results in $array will be converted to excel i tried this tutorial

Re: [fw-general] Create an Excel file from the returned table rows

2009-07-14 Thread Саша Стаменковић
Hi. Zend_Db_Table_Abstract::fetchAll() * @return Zend_Db_Table_Rowset_Abstract The row results per the Zend_Db_Adapter fetch mode. So, its Zend_Db_Table_Rowset_Abstract type you get, not an array.You can use Zend_Db_Table_Rowset_Abstract::toArray() if you want an array, or iterate trough

Re: [fw-general] Create an Excel file from the returned table rows

2009-07-14 Thread jigen7
so i need to convert $array to an array? by using this Zend_Db_Table_Rowset_Abstract::toArray($array)??? -- View this message in context: http://www.nabble.com/Create-an-Excel-file-from-the-returned-table-rows-tp24474784p24474874.html Sent from the Zend Framework mailing list archive at

Re: [fw-general] Actionstack bad, Layout and View Helpers good??

2009-07-14 Thread Dalibor Karlović
On Tuesday 14 July 2009 08:29:43 Sam Davey wrote: (...) The articles suggest that its fine to allow read access to models from the View via the ViewHelper. So basically all I need to do is grab the date from the URL and send it to the Model via the ViewHelper. I can then spit out the

Re: [fw-general] Fw: $request-getParams() returns escaped data

2009-07-14 Thread Dalibor Karlović
On Tuesday 14 July 2009 06:03:26 Matthew Weier O'Phinney wrote: -- Muhammad Ali imjob@live.com wrote (on Monday, 13 July 2009, 09:16 PM +0100): An other quick question for the mailing list, does using Zend_Config as Array rather as INI files improves performance, is it worth doing?

Re: [fw-general] Create an Excel file from the returned table rows

2009-07-14 Thread Саша Стаменковић
O.K. Let's fix your code: //Your $table = new Model_Crescores(); $select = $table-select(); $select-order('cap_no'); $array = $table-fetchAll($select); //Fixed $table = new Model_Crescores(); $select = $table-select(); $select-order('cap_no'); $rowset = $table-fetchAll($select); $array =

Re: [fw-general] Fw: $request-getParams() returns escaped data

2009-07-14 Thread Muhammad Ali
Hi DaliborKarlovic, Well my aim is to save as much as possible, and in my opinion caching is not an option either. My idea is put everything in INI file but the first request generates the php file with array configuration and there after all other requests are served from php file. I can

Re: [fw-general] Create an Excel file from the returned table rows

2009-07-14 Thread jigen7
thank you very much really appreciate it ^^ im still not use and aware in some zend functionality thanks -- View this message in context: http://www.nabble.com/Create-an-Excel-file-from-the-returned-table-rows-tp24474784p24475082.html Sent from the Zend Framework mailing list archive at

Re: [fw-general] Create an Excel file from the returned table rows

2009-07-14 Thread Саша Стаменковић
Just check datatype before use variables, zf is well documented and it's easy to navigate methods and look into docblocks. Regards, Saša Stamenković On Tue, Jul 14, 2009 at 9:45 AM, jigen7 i_love_ji...@yahoo.com wrote: thank you very much really appreciate it ^^ im still not use and aware in

[fw-general] DateTextBox setPromptMessage not showing tooltip

2009-07-14 Thread Gabby403
?php class SMARTForm extends Zend_Dojo_Form { public function init() { $this-setMethod('post'); $this-setName('SMARTForm'); $vtb = new Zend_Dojo_Form_Element_ValidationTextBox('goalName');

Re: [fw-general] XSS Prevention with Zend Framework

2009-07-14 Thread Tobias Petry
Ondrej Ivanič-3 wrote: Thats sounds like a ZF version of magic_quotes... How do you want to deal with different escaping in javascript, css, html, xml? View script could be mix of anything i.e: I think it won't be something like magic_quotes because it is at no point secure, in my humble

Re: [fw-general] XSS Prevention with Zend Framework

2009-07-14 Thread Pádraic Brady
PHP's magic_quotes was a mistake because it failed to do anything useful and instead created more problems that lead to greater insecurity and uncertainty instead. Automatic escaping with ZF 2.0 is anything but - it is a simple concept whereby html escaping is applied by default to any request

Re: [fw-general] XSS Prevention with Zend Framework

2009-07-14 Thread Marian Meres
Hello, I guess Ondrej was just pointing out, that escaping itself is a little bit more complex than just htmlspecialchars-ing the data. And *automaticaly impossible* with default ZF view design (phtml templates) in a meaning that it still requires human to change the escaping method based on the

Re: [fw-general] Create an Excel file from the returned table rows

2009-07-14 Thread joostvanveen
And now for your Excel export code, given a random array stored in $array. ?php // Set filename for download $fileName = 'my_excel_export'; if (count($array) == 0) { throw new Zend_Exception('Sorry, there is no data available to export.'); } else { // Initiate data variable that

Re: [fw-general] Actionstack bad, Layout and View Helpers good??

2009-07-14 Thread Pádraic Brady
It's one of those ongoing debates ;). Those who avoid ActionStack (disclaimer: I rarely use them) believe that reusing Controllers in order to construct a View is symtomatic of a poorly designed Controller system. Controllers are nothing more than supervisors - the Models and View should do all

[fw-general] Updating another field on change of a horizontalSlider

2009-07-14 Thread Gabby403
I'm trying to add a further function on to the HorizontalSlider onChange function, unfortunatly when I do this through the constructor it overrides the default onChange event(s), since one of these events is updating the hidden which I'm trying to update from it all ends rather disastoursly, is

[fw-general] Zend_Acl::add() may not accept extended classes

2009-07-14 Thread J DeBord
I'm experimenting with Zend_Acl and even though what I am doing may not be the best way to go about hiding/displaying navigation, the error message below does not appear to be correct:* Catchable fatal error*: Argument 1 passed to Zend_Acl::add() must implement interface

[fw-general] create custom FormSelect

2009-07-14 Thread flow
Hi there, I have the following Problem: I need a select-box which option's cam have different html class attributes. Since the default Zend_Form_Element_Select does not provide this, I guess I need to write a custom select element - but I don't know how to start. Do I need a to create a new

Re: [fw-general] Zend_Acl::add() may not accept extended classes

2009-07-14 Thread Ralph Schindler
Hmm, are you sure that you are loading the correct object? Where is this code located? I notice that it implements Zend_Acl_Resource_Interface, but there is already a class called Zend_View_Helper_Navigation being loaded by the framework already right? Where is your custom code being stored?

Re: [fw-general] XSS Prevention with Zend Framework

2009-07-14 Thread Matthew Weier O'Phinney
-- Ondrej Ivanič ondrej.iva...@gmail.com wrote (on Tuesday, 14 July 2009, 03:47 PM +1000): fixing that...), but I will note: Starting with 2.0, escaping will be the default when retrieving variables from the view object, and you will need to request the raw value explicitly if you need it.

Re: [fw-general] Zend_Acl::add() may not accept extended classes

2009-07-14 Thread J DeBord
Ahh, I did not realize there was a Zend_View_Helper_Navigation. Thus when I instantiate my Acl class it in the bootstrap it loads Zend_View_Helper_Navigation from the library/Zend folder, while in my layout script it is loading from my application/views/helpers folder. Since I prefix my custom

[fw-general] Rename file after upload

2009-07-14 Thread holografix .
Hi In my form I have a Zend_Form_Element_File like this: $image = new Zend_Form_Element_File('Image'); $image-setLabel('Image') -setDestination('c:/temp') -addFilter('Rename', 'Art_1234') -addValidator('Size', false, '1M')

[fw-general] escaping for zend_db

2009-07-14 Thread Mark Wright
I want to insert a variable into a LIKE query using zend_db_statement but I'm not sure how to do this correctly. This doesn't work: $selectObj-where(name LIKE '%?%', $var ); It gives you name LIKE '%'some text'%'. I can do this: $selectObj-where(name LIKE ?, '%' . $var . '%' ); What I really

Re: [fw-general] Zend_Acl::add() may not accept extended classes

2009-07-14 Thread Ralph Schindler
The question becomes what do you want to hide/show navigation based on? Is it based on where you currently are in an application (which controller/action/module?) Or is it based on who you are? User/Group information? If its the latter, I would probably implement the Role

[fw-general] Url helper ignores setParams() - why?

2009-07-14 Thread hussdl
I would like to turn GET params coming from a form into ZF params: Controller: $front = Zend_Controller_Front::getInstance(); $front-setParams($_GET); $front-getRequest()-setParams($_GET); $front-getRouter()-setParams($_GET); $form-isValid($this-_getAllParams()); View: $this-url(array('page'

Re: [fw-general] escaping for zend_db

2009-07-14 Thread till
On Tue, Jul 14, 2009 at 7:33 PM, Mark Wrightsparkymeis...@gmail.com wrote: I want to insert a variable into a LIKE query using zend_db_statement but I'm not sure how to do this correctly. This doesn't work: $selectObj-where(name LIKE '%?%', $var ); It gives you name LIKE '%'some text'%'. I

Re: [fw-general] escaping for zend_db

2009-07-14 Thread till
On Tue, Jul 14, 2009 at 7:43 PM, tillklimp...@gmail.com wrote: On Tue, Jul 14, 2009 at 7:33 PM, Mark Wrightsparkymeis...@gmail.com wrote: I want to insert a variable into a LIKE query using zend_db_statement but I'm not sure how to do this correctly. This doesn't work: $selectObj-where(name

Re: [fw-general] Zend_Session : associating a session with a registered user?

2009-07-14 Thread hussdl
This problem has been resovled by modifying the SaveHandler to preserve selected columns in the session table during a request and by adding a killme flag to the table that will cause flagged sessions to expire immediately on the next read/write access. -- View this message in context:

Re: [fw-general] escaping for zend_db

2009-07-14 Thread Ralph Schindler
use this one: $selectObj-where('name LIKE ?', '%' . $var . '%'); but if you must quote on your own: $selectObj-where('name LIKE ' . $adapter-quote('%' . $var . '%')); With parameterization, you should not need to quote/escape things on your own (unless for some reason you want to have the

Re: [fw-general] Zend_Acl::add() may not accept extended classes

2009-07-14 Thread J DeBord
I would like to display navigation based on* who* you are. Here is what I've done in a view_helper, though it would be great to integrate this into my Acl since I'm checking user roles against it every request already. Ralph, could you elaborate a bit on : I would probably implement the Role

[fw-general] Zend_Filter_StripTags strips attributes even when told not to

2009-07-14 Thread J DeBord
I've tried to make StripTags leave the href attribute, but it strips it out. I can't find the right syntax or it just doesn't work. The a tag is left intact, every other tag is stripped, but the href and title get stripped as well. I've also used the fluid interface when adding the Textarea, but

Re: [fw-general] escaping for zend_db

2009-07-14 Thread Mark Wright
I'm sure I was over thinking this. I ultimately went with this: $selectObj-where(name LIKE ?, '%' . $var . '%' ); It works fine but I still think it would be nice if the adapter had a simple escape method rather than just quote methods. Mark On Tue, Jul 14, 2009 at 11:43 AM,

Re: [fw-general] Zend_Acl::add() may not accept extended classes

2009-07-14 Thread Ralph Schindler
I haven't had a chance to fully explore this use case, but I'll throw out some pseudo code that might get the wheels turning. Assuming your models might look like this: class User implements Zend_Acl_Role_Interface { ... public function getRoleId() { return $this-role; // or whatever

[fw-general] Zend_Navigation homepage problem

2009-07-14 Thread Marko Korhonen
Hi, I have evil problem in my hands and I have tried everything. Situation: I have one level primary navigation, 5 pages in the same level. If I'm on the homepage, all 5 pages are set active...?? I have tried to force them down but no success. Here's my ini: profile.label = user-profile

Re: [fw-general] Rename file after upload

2009-07-14 Thread Thomas Weidner
Holo, reading the manual you may note that options have to be in array notation. See http://framework.zend.com/manual/en/zend.form.elements.html#zend.form.elements.filters and you may note that the rename filter expects a target. See

[fw-general] Simple Zend_Form without MVC ..

2009-07-14 Thread tipler
Hi!, I'm trying to do the following simple form with Zend_Form without MVC, but I have the problem: Warning: ViewHelper decorator cannot render without a registered view object in /usr/local/lib/ZendFramework-1.8.0/library/Zend/Form/Element.php on line 1929 I don't understand relationship

Re: [fw-general] Actionstack bad, Layout and View Helpers good??

2009-07-14 Thread Sam Davey
Thanks Paddy, And thanks for the 'Complex Views with the Zend Framework ' series of blog posts way back in 2007 which explained so much of what was missing from ZF V1.0 and what strategies could resolve it. Kept me sain when I thought complex view would never be possible. Your points have

[fw-general] File Rename Filter Not Picked Up

2009-07-14 Thread korpz
Hi there I have a form with a file field which looks like this: $photo = new Zend_Form_Element_File('image'); $photo-setLabel('Upload your photo.') -setDecorators($this-_standardElementDecorator) -setRequired(false)

Re: [fw-general] Zend_Filter_StripTags strips attributes even when told not to

2009-07-14 Thread Matthew Weier O'Phinney
-- J DeBord jasdeb...@gmail.com wrote (on Tuesday, 14 July 2009, 08:29 PM +0200): I've tried to make StripTags leave the href attribute, but it strips it out. I can't find the right syntax or it just doesn't work. The a tag is left intact, every other tag is stripped, but the href and title get

Re: [fw-general] Simple Zend_Form without MVC ..

2009-07-14 Thread Matthew Weier O'Phinney
-- tipler tip...@gmail.com wrote (on Tuesday, 14 July 2009, 12:45 PM -0700): Hi!, I'm trying to do the following simple form with Zend_Form without MVC, but I have the problem: Warning: ViewHelper decorator cannot render without a registered view object in

[fw-general] Zend_Db::replace() ?

2009-07-14 Thread A.J. Brown
Hey Guys, Am I missing something, or is there no way to implement MySQL's replace in Zend_Db using the API? -- A.J. Brown web | http://ajbrown.org phone | (937) 660-3969

Re: [fw-general] XSS Prevention with Zend Framework

2009-07-14 Thread Ondrej Ivanič
Hi On Wed, Jul 15, 2009 at 2:39 AM, Matthew Weier O'Phinneymatt...@zend.com wrote: Within your view, you, the developer, know your context, so it's up to you to define the escaping mechanism. We're just going to provide a sane default for the 80/20 use case. 80/20 is a nice rule but not for

Re: [fw-general] XSS Prevention with Zend Framework

2009-07-14 Thread Pádraic Brady
Finally, proposed solution seems to be the best one, with the current Zend_View design, but it's wrong to thing that you rise level of security in your application; the level is still same as a before. I have to disagree - simply by removing the need to manually escape everything removes the

[fw-general] Action names

2009-07-14 Thread Muhammad Ali
Hi I have ACL plugin to restrict different controllers and User controller have action called changePasswordAction. I can get to action using /user/change-password/ and it works fine, but before while i am constructing my Acl action name comes as change-password rather changePassword. Is this

Re: [fw-general] Zend_Db::replace() ?

2009-07-14 Thread Matthew Weier O'Phinney
-- A.J. Brown a...@ajbrown.org wrote (on Tuesday, 14 July 2009, 07:46 PM -0400): Am I missing something, or is there no way to implement MySQL's replace in Zend_Db using the API? You're not missing anything -- it's not there, by design. Zend_Db is a database abstraction layer; the goal of any

Re: [fw-general] XSS Prevention with Zend Framework

2009-07-14 Thread Matthew Weier O'Phinney
-- Ondrej Ivanič ondrej.iva...@gmail.com wrote (on Wednesday, 15 July 2009, 10:09 AM +1000): On Wed, Jul 15, 2009 at 2:39 AM, Matthew Weier O'Phinneymatt...@zend.com wrote: Within your view, you, the developer, know your context, so it's up to you to define the escaping mechanism. We're