[fw-general] How to check the SQL string created by Zend_Db_Select?

2009-02-20 Thread Deepak Shrestha
Hi, How can we check the SQL string created by select? for example: given this $select-where ( conditions); $select-orwhere ( conditions); $select-order ( conditions); I want to check the complete SQL statement it has created Zend_Debug::Dump($select) doesn't provide what I wanted to know.

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

2009-02-18 Thread Deepak Shrestha
On Tue, Feb 17, 2009 at 2:31 PM, Deepak Shrestha d88...@gmail.com wrote: 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

[fw-general] Zend_Paginator's totalItemCount property question?

2009-02-18 Thread Deepak Shrestha
Hi all, When trying to access the totalItemCount property of Paginator, I am getting this error: == Notice: Undefined property: Zend_Paginator::$totalItemCount == Is this bug? Problem elaboration === before using paginator, my

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

Re: [fw-general] Is parameter value disappears on the way?

2009-02-15 Thread Deepak Shrestha
On Sat, Feb 14, 2009 at 7:14 PM, PHPScriptor cont...@phpscriptor.com wrote: Would be nice if you told us what your (stupid :-D) blunder was... In case someone has the same problem, he would not have to ask again... Sorry I forgot about it. Actually it was really stupid :-) Basically I have a

[fw-general] Form values and paginator question

2009-02-15 Thread Deepak Shrestha
Hi, I need some hint on using paginator with search form. If I have following code in my controller = if($request-isPost()) { if ($form-isValid($request-getPost())) { $req = $form-getValues(); $pageno

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

2009-02-15 Thread Deepak Shrestha
On Sun, Feb 15, 2009 at 8:49 PM, PHPScriptor cont...@phpscriptor.com wrote: Well there are some sollutions: 1. put the form values in a session. 2. put your form values in the url Got that. :-) I was thinking other way round. Actually my question should be does paginator retains the

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

2009-02-15 Thread Deepak Shrestha
2. put your form values in the url but anyway I got the answer already. Not really My question is how to modify the view partial script of paginator control (mypaginator.phtml) so that it will send the form data along with requested page number Initially my url is

[fw-general] Is parameter value disappears on the way?

2009-02-14 Thread Deepak Shrestha
hi, Tracing my previous problem on why I cannot paginate with paginator, I found out that the value I passed from controller to model is not interpreted properly. supposing clicking next button in paginator control, i got this url http://myweb/index/index/page/2 In my controller

[fw-general] Preserving hard return in textarea

2009-02-13 Thread Deepak Shrestha
Hi How do I preserve the hard return (CR CR/LF) entered in textarea in zend_form? Currently my filter for textarea is StringTrim and NotEmpty. I thought I am getting this because $this-escape is used in my view script. I tried removing it but I am still getting the same output (everything in one

Re: [fw-general] Another Zend_paginator Question

2009-02-13 Thread Deepak Shrestha
On Fri, Feb 13, 2009 at 2:54 PM, Deepak Shrestha d88...@gmail.com wrote: Let me explain a bit so that it will be clear about 1. what I am trying to do 2. where I am doing wrong and 3. where I need to fill up the missing pieces. My front page is where all the records are shown so I wanted

Re: [fw-general] Zend_Paginator Question

2009-02-12 Thread Deepak Shrestha
On Tue, Feb 10, 2009 at 11:58 PM, keith Pope mute.p...@googlemail.com wrote: Heres what I do, this is within a model resource Model has Resource - Zend_Db_Table. public function getProductsByCategory($categoryId, $paged=null, $order=null) { $select = $this-select();

Re: [fw-general] Zend_Paginator Question

2009-02-12 Thread Deepak Shrestha
this file structure in the same place as the view script? === views scripts index index.phtml mypagintor.phtml using this I got file not found error. and this modification solved the problem === div id=pgcontrol

[fw-general] Another Zend_paginator Question

2009-02-12 Thread Deepak Shrestha
Hi, So far I am able to use the Zend_Paginator to display the limited results but I cannot forward through pages yet. I guess I need to track the page number request from paginator control (either through URL or using Zend_Controller_Router_Interface) but before doing that I have some questions.

Re: [fw-general] Another Zend_paginator Question

2009-02-12 Thread Deepak Shrestha
You are PHPScriptor. Arn't you? I like your answering style :-) In the same directory I think you mean. Yes. so that means what I am doing is fine. public function setupRoutes(Zend_Controller_Front $frontController) { $router = $frontController-getRouter(); $router-addRoute(

Re: [fw-general] Another Zend_paginator Question

2009-02-12 Thread Deepak Shrestha
Let me explain a bit so that it will be clear about 1. what I am trying to do 2. where I am doing wrong and 3. where I need to fill up the missing pieces. My front page is where all the records are shown so I wanted to use the paginator. For the simplicity I want to fetch all the records from

Re: [fw-general] [OT-PHP] Insert an associative array at beginning

2009-02-11 Thread Deepak Shrestha
On Wed, Feb 11, 2009 at 4:39 PM, Moritz Mertinkat mor...@mertinkat.net wrote: Hi there, the problem is that array_splice doesn't care about your string keys. The manual states that array_splice($input, 0, 0, array($x, $y)) is identical to array_unshift($input, $x, $y) which should make it

[fw-general] Zend_Paginator Question

2009-02-10 Thread Deepak Shrestha
Hi, Short and quick question: I need some background and hint on how to use Paginator in strict Zend Framework MVC convention? (no customization) also some insight on Zend_Controller_Router_Interface. I cannot find enough information in documentation to grasp this.

Re: [fw-general] Zend_Paginator Question

2009-02-10 Thread Deepak Shrestha
On Tue, Feb 10, 2009 at 7:31 PM, PHPScriptor cont...@phpscriptor.com wrote: I don't know if this will answer your question, but this is how I do it: The paginator is set in the controller. I think you could do it in the model, but that would make things a lot complicater. Where to define

Re: [fw-general] Zend_Paginator Question

2009-02-10 Thread Deepak Shrestha
On Tue, Feb 10, 2009 at 9:15 PM, PHPScriptor cont...@phpscriptor.com wrote: You always come back in your controller. The zend paginator add's the param 'page' in the url. So you always do a requery. (if that's what you wanted to say). http://localhost/news become http://localhost/news/page/1

[fw-general] [OT-PHP] Insert an associative array at beginning

2009-02-10 Thread Deepak Shrestha
Hi, I got confused on why this is not working. I have an array of locations stored in $location variable which is fetched using fetchPairs(). I wanted to add and element Any = Any at the beginning of this $location. so my $locations is [from Zend_Degug::Dump($locations)]: =

Re: [fw-general] Why $form-getValue() is not working?

2009-02-08 Thread Deepak Shrestha
On Sun, Feb 8, 2009 at 2:03 AM, A.J. Brown fynw...@gmail.com wrote: Hi Deepak, Can you pastebin both the controller and the form (in seperate pastes)? Attaching would be fine too. I'll help you debug it. -- A.J. Brown web | http://ajbrown.org phone | (937) 660-3969 Hi, here are the

Re: [fw-general] Why $form-getValue() is not working?

2009-02-08 Thread Deepak Shrestha
On Sun, Feb 8, 2009 at 9:22 PM, PHPScriptor cont...@phpscriptor.com wrote: your viewscript: ? $this-searchstr ? does that work? try something like this: ?php echo $this-searchstr; ? or ?= $this-searchstr; ? - visit my website at http://www.phpscriptor.com/

Re: [fw-general] Why $form-getValue() is not working?

2009-02-07 Thread Deepak Shrestha
plus I noticed something. I tried to enter the string What da Hell and it gives me invalid string error? why I can't type a sentence? what's wrong with the validation? Does this have something to do with the problem? Thank you for your patience. Plus I noticed that it is causing by my

[fw-general] How to set option for 'Alnum' validator?

2009-02-07 Thread Deepak Shrestha
Hi, One quick question. How to set the option for 'Alnum' validator to accept white space? Thanks -- === Registered Linux User #460714 Currently Using Fedora 8, 10 ===

[fw-general] Re: How to set option for 'Alnum' validator?

2009-02-07 Thread Deepak Shrestha
On Sat, Feb 7, 2009 at 7:10 PM, Deepak Shrestha d88...@gmail.com wrote: Hi, One quick question. How to set the option for 'Alnum' validator to accept white space? Thanks Hi found the solution after digging inside Alnum.php itself: including the third parameter like this solved the problem

[fw-general] Why $form-getValue() is not working?

2009-02-06 Thread Deepak Shrestha
Hi, I am trying to implement a simple search function. For the test purpose I am trying to display the search string in my view. This is how it looks like: my form -- class Form_Search extends Zend_Form { public function init() { //create search text input

Re: [fw-general] Why $form-getValue() is not working?

2009-02-06 Thread Deepak Shrestha
On Fri, Feb 6, 2009 at 7:01 PM, PHPScriptor cont...@phpscriptor.com wrote: Try this: $this-getPost('qsearch'); It gives me: = Application error Exception information: Message: Method getPost does not exist and was not trapped in __call() === Trying

Re: [fw-general] Why $form-getValue() is not working?

2009-02-06 Thread Deepak Shrestha
On Fri, Feb 6, 2009 at 10:43 PM, PHPScriptor cont...@phpscriptor.com wrote: I'm assuming that if your method getPost does not exist that your $request-isPost() and isValid($request-getPost()) will also not work. Try to do a var_dump of $request-getPost(); and your $request. Hi, I agree with

Re: [fw-general] Why $form-getValue() is not working?

2009-02-06 Thread Deepak Shrestha
Hi, It looks like you're not setting post as the method. $form-setMethod( 'post' ); $this-view-form = $form; The form's method is set to post now (sorry I forgot; my bad) but I am still getting the same result. It's not the best way but you can do it like this maybe: $data =

Re: [fw-general] How to display validator specific error message in Zend_Form?

2009-02-05 Thread Deepak Shrestha
On Thu, Feb 5, 2009 at 10:08 PM, A.J. Brown fynw...@gmail.com wrote: On Wed, Feb 4, 2009 at 9:44 PM, Deepak Shrestha d88...@gmail.com wrote: Thanks. How about assigning specific error message to each validator? Use the options array (3rd parameter). The key should be 'messages

[fw-general] How to display validator specific error message in Zend_Form?

2009-02-04 Thread Deepak Shrestha
Hi, I have text element in the form with two validators +--- $mytext= New Zend_Form_Element_Text('mytext'); $mytext-setLabel('Enter Text:'); $mytext-setAttrib('size', '40'); $mytext-setRequired(true);

Re: [fw-general] How to display validator specific error message in Zend_Form?

2009-02-04 Thread Deepak Shrestha
What I actually wanted to do is: * Empty string will be checked first and shown error message ignoring other validators. So if the string is empty show the error message for empty string validator and exit from validator chain ignoring other validators

Re: [fw-general] Form layout update didn't get reflected

2009-02-02 Thread Deepak Shrestha
Hmm, I tried it, and seems to be working fine... You didn't use decorators? Did you look at your html source output? Did you try cleaning up your browser history? Everything is default from ZF. No decorators. Yes html source shows the previous order of elements. Yes in my firefox setting it

Re: [fw-general] Populating Zend_Form_Element_Select from database example

2009-02-01 Thread Deepak Shrestha
Yes, add a setter method for attaching the model to the form and then do this in the controller. The form will then have access to the model to retrieve any data it needs. You can also populate the element directly in your controller by retrieving it from the form and manipulating it e.g.

[fw-general] Array Index included question?

2009-02-01 Thread Deepak Shrestha
hi, I am not sure if this is related to ZF but anyway I am asking it here. I have a one column table (called location) in my database. ++ | locname | this is also the primary key ++ | location 1 | ++ | location 2

Re: [fw-general] Array Index included question?

2009-02-01 Thread Deepak Shrestha
Just for confirmation, is this what I am getting? array('location1' = 'location1', 'location2' = 'locatino2' ...) This is what I desired instead of === array('somevalue' = 'location1', 'somevalue' = 'location2' ...) === I got he desired result

[fw-general] Form layout update didn't get reflected

2009-02-01 Thread Deepak Shrestha
Hi, I changed the order of few elements inside the Form but whenever I access the form it is showing me the same Form from previous layout. My update didn't get reflected. I tried clearing the browser cache and all still the same. Is cache working behind the scene somewhere? Thanks --

Re: [fw-general] Form layout update didn't get reflected

2009-02-01 Thread Deepak Shrestha
On Mon, Feb 2, 2009 at 2:54 PM, PHPScriptor cont...@phpscriptor.com wrote: Not that I know. But if you post your code, we can have a closer look... my Form code: ?php class Form_PostInfo extends Zend_Form { public function init() { //create title element

[fw-general] Populating Zend_Form_Element_Select from database example

2009-01-31 Thread Deepak Shrestha
Hi, I am confused on how to populate the Select element from database. In the Select element I need to fill it with location data which is stored in database as single field table (each item is unique) location -- location1 location2 location3 ... ... etc. -- There is

Re: [fw-general] Re: Populating Zend_Form_Element_Select from database example

2009-01-31 Thread Deepak Shrestha
On Sat, Jan 31, 2009 at 9:23 PM, Daniel Latter dan.lat...@gmail.com wrote: shoudnt $adlocation be $location? Thank You Daniel Latter sorry for that, it is all $location (typo). When form renders I can see the error message that Invalid argument supplied for foreach() in TestForm.php at line

Re: [fw-general] Populating Zend_Form_Element_Select from database example

2009-01-31 Thread Deepak Shrestha
It looks like your doing it correct except for the array of data that you're using to populate the form. You're not actually populating the select element with options, you only want the current Or selected option to be selected in the select list on display. So in your case it's probably a

Re: [fw-general] Populating Zend_Form_Element_Select from database example

2009-01-31 Thread Deepak Shrestha
On Sat, Jan 31, 2009 at 10:37 PM, gerardroche bullfrogbl...@live.com wrote: you would just do this try this first: $data = array( 'location' = 'location1' ); $form-populate($data); when the form is displayed it should show a select list of location options with location1 selected.

Re: [fw-general] Populating Zend_Form_Element_Select from database example

2009-01-31 Thread Deepak Shrestha
On Sat, Jan 31, 2009 at 10:48 PM, Daniel Latter dan.lat...@gmail.com wrote: Are you sure your setting $this-data variable in the form class?, and if so var_dump it to see what it contains? My sample trial code in my controller == $data = array('location1' = 'location1'); $form

Re: [fw-general] Populating Zend_Form_Element_Select from database example

2009-01-31 Thread Deepak Shrestha
no. Change in my controller to the following in my controller == $data = array('location' = 'location1'); $form= $this-_getTestForm(); $form-populate($data); ... == all i did was change the array from $data = array('location1' =

Re: [fw-general] Populating Zend_Form_Element_Select from database example

2009-01-31 Thread Deepak Shrestha
On Sat, Jan 31, 2009 at 11:46 PM, gerardroche bullfrogbl...@live.com wrote: you keep moving the goal posts. put this in your form, to the letter: $location= New Zend_Form_Element_Select('location'); $location-setLabel('*Location:'); $location-setMultiOptions(array('location1' =

Re: [fw-general] Populating Zend_Form_Element_Select from database example

2009-01-31 Thread Deepak Shrestha
On Sun, Feb 1, 2009 at 12:37 AM, Daniel Latter dan.lat...@gmail.com wrote: a) Do I need to declare global variable in my form class plus getter, setter methods so that Controller can set that variable through those methods and I can use the data provided in that variable? yes. so what is the

[fw-general] Re: Zend_Captcha custom error message question

2009-01-28 Thread Deepak Shrestha
On Wed, Jan 28, 2009 at 3:23 PM, Deepak Shrestha d88...@gmail.com wrote: Ok, I found a Warning displayed at top of my form after validation. The Message: = Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\WEB\myweb\library\Zend\View\Abstract.php

[fw-general] Re: Zend_Captcha custom error message question

2009-01-28 Thread Deepak Shrestha
Hi, me again it is solved now by doing this == $captchaimg-setMessage(My Custom Message, 'badCaptcha'); == This came to my mind only after I did some digging around and had a look at the code 'Zend/captcha/Word.php' (ancestor class) Where the message template

[fw-general] Zend_Captcha custom error message question

2009-01-27 Thread Deepak Shrestha
Hi, Breaking from previous post, I am posting this as a new subject. I am using Zend_From to display captcha with custom error message. When I make a wrong entry (intentionally), my custom error message is not shown when form validates. Sample code: //first create an

[fw-general] Re: Zend_Captcha custom error message question

2009-01-27 Thread Deepak Shrestha
Ok, I found a Warning displayed at to of my form after validation. The Message: = Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\WEB\myweb\library\Zend\View\Abstract.php on line 804 What does this mean? Thanks --

[fw-general] Re: How to use Image based Captcha?

2009-01-26 Thread Deepak Shrestha
Hi, I found out that image is being generated. Also because of $captchaimg-generate(); command its being generated twice. So I replaced the 'generate()' with $captchaimg-setWordlen('5'); Now I can see that every time I display the form page, new image is generated in the 'captcha/images' folder

[fw-general] Zend_Form or Captcha bug?

2009-01-26 Thread Deepak Shrestha
Hi, Didn't get any help from my last post so I went through documentation and tried to understand as much I can but can't find a way to display captcha image in Zend_Form using default behavior of Zend Framework's MVC. AFAIK (with my current knowledge), my code is correct. This is the code

[fw-general] Re: Zend_Form or Captcha bug?

2009-01-26 Thread Deepak Shrestha
On Tue, Jan 27, 2009 at 3:24 PM, Deepak Shrestha d88...@gmail.com wrote: Hi, Didn't get any help from my last post so I went through documentation and tried to understand as much I can but can't find a way to display captcha image in Zend_Form using default behavior of Zend Framework's MVC

[fw-general] How to use Image based Captcha?

2009-01-25 Thread Deepak Shrestha
Hi, I am absolutely new to ZF. Right now I am playing around with the Quickstart files. So far I am bit comfortable with the concepts. Now I want to change the provided zend captcha (figlet) into image type but can't find any example of this in the zend documentation. This is what I came up with

[fw-general] Re: How to use Image based Captcha?

2009-01-25 Thread Deepak Shrestha
After reading the list archive http://www.nabble.com/Zend_Captcha-td20300142.html#a20300142 , I figured out my mistake. Now I have made changes and code looks like this ... ... ... //first create an image type captcha $captchaimg = New

[fw-general] quickstart tutorial create layout help

2009-01-07 Thread Deepak Shrestha
Hi, I am completely new to ZF and following the quickstart guide. It was doing OK until I reached the part Create Layout section (http://framework.zend.com/docs/quickstart/create-a-layout) my page start to show something unusual. I cannot understand this yet. Things that might help:

Re: [fw-general] quickstart tutorial create layout help

2009-01-07 Thread Deepak Shrestha
On Wed, Jan 7, 2009 at 4:48 PM, keith Pope mute.p...@googlemail.com wrote: Looks like you dont have short tags enabled for your php install. In your .htaccess use php_value short_open_tag on It works now. Can move on with tutorials Thanks -- === Registered Linux User