Re: [fw-general] Zend_View_Helper Supply constants to a view helper

2009-08-21 Thread Hector Virgen
I like the idea of placing the values in a config, but I don't like the idea of the view helper reading from the config. It may be better for the view helper to be injected with value early on, like perhaps in a bootstrap resource (which works naturally with configs). // in Bootstrap.php

Re: [fw-general] How to get forwarded page url/path?

2009-08-20 Thread Hector Virgen
I've used a query parameter to accomplish this. The link to my login page looks like this: a href=/login?to=/some/other/pageLogin/a When the login page is visited, the auth controller checks for the to parameter and saves it in a session namespace that automatically expires in 5 minutes. When the

Re: [fw-general] How to get forwarded page url/path?

2009-08-20 Thread Hector Virgen
this: /login/referrer/path/to/page If you change it to use a query string, it should work: /login?referrer=path/to/page -- Hector On Thu, Aug 20, 2009 at 8:41 AM, Enkhbilguun Erdenetsogt enkhbilg...@beregu.com wrote: Thank you Hector Virgen, Daniel Latter and kamil for your kind advise

Re: [fw-general] Using Zend_Db_Select without a db connection

2009-08-19 Thread Hector Virgen
. greetings, Benjamin On Wednesday 19 August 2009 06:50:52 pm Hector Virgen wrote: Hello, I am currently working on an older project that is not in ZF, but I'd like to use Zend_Db_Select to help me build some complex select queries. I don't want to open a new connection to the database since

[fw-general] Using Zend_Db_Select without a db connection

2009-08-19 Thread Hector Virgen
Hello, I am currently working on an older project that is not in ZF, but I'd like to use Zend_Db_Select to help me build some complex select queries. I don't want to open a new connection to the database since this application already has one open using good ol' mysql_connect(). My question is,

Re: [fw-general] Cannot use multiple select() objects?

2009-08-19 Thread Hector Virgen
That's because objects are copied by reference in PHP. Use clone instead: $firstSelect = clone $baseSelect; -- Hector On Wed, Aug 19, 2009 at 1:38 PM, Phillip Winn pwinn...@gmail.com wrote: I would like to start with a base query and try first one where clause, and if that fails, another.

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

2009-08-13 Thread Hector Virgen
petewarn...@gmail.comwrote: On Tue, Aug 11, 2009 at 11:07 AM, Hector Virgen djvir...@gmail.comwrote: 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

Re: [fw-general] Introducing Zend Framework to existing System/Website

2009-08-13 Thread Hector Virgen
I've done this before by using .htaccess and a separate index file for the ZF portion of the website. Basically it works like this: Generally, all pages are routed to index.php in your original application (or maybe visitors hit the pages directly, like signup.php and login.php). So the idea is

Re: [fw-general] Zend_Layout not using ViewRenderer suffix

2009-08-13 Thread Hector Virgen
You need to pass your custom view to the layout: protected function _initLayout() { $view = $this-getResource('view'); $layout = Zend_Layout::getMvcInstance(); $layout-setView($view); } -- Hector On Thu, Aug 13, 2009 at 3:35 PM, Steven Szymczak sc.szymc...@googlemail.com wrote:

Re: [fw-general] Zend controllers help

2009-08-13 Thread Hector Virgen
It looks like you're missing an apache setting. In order for the routing to work, you must have .htaccess file in your public folder (which Zend_Tool provides) *and* you have to allow that directory to use .htaccess files in your apache config. Add this to your apache config and restart apache:

Re: [fw-general] Zend_Layout not using ViewRenderer suffix

2009-08-13 Thread Hector Virgen
/Bootstrap.php on line 63 For some reason, Zend_Layout::getMvcInstance() isn't returning an object. Hector Virgen wrote: You need to pass your custom view to the layout: protected function _initLayout() { $view = $this-getResource('view'); $layout = Zend_Layout::getMvcInstance(); $layout

Re: [fw-general] Zend_Layout not using ViewRenderer suffix

2009-08-13 Thread Hector Virgen
Actually, looks like Zend_Layout has its own setViewSuffix method. $layout-setViewSuffix('html'); -- Hector 2009/8/13 Steven Szymczak sc.szymc...@googlemail.com It's still not picking up on the suffix (still wants 'phtml'). Hector Virgen wrote: Oops, you need to call Zend_Layout::startMvc

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

2009-08-11 Thread Hector Virgen
Hello, 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? I tried this, but it ended up adding the class name foo to all of the checkboxes: $this-addElement('multiCheckbox',

Re: [fw-general] Where is my Zend_Config???

2009-08-11 Thread Hector Virgen
There are a couple ways to store the config. In the past I've stored it in Zend_Registry, which can be pulled out later at any time: // in bootstrap Zend_Registry::set('config', $config); // in controller $config = Zend_Registry::get('config'); Another option is to store it directly in the front

Re: [fw-general] Hide a Zend_Form_Element

2009-08-10 Thread Hector Virgen
Do you need it to be invisible but submitted with the post data? Try making it a hidden input field: $this-addElement('hidden', 'myfield', array(/* ... */)); Or you can remove the element completely if you don't need it to be submitted: $form = new MyForm(); $form-removeElement('myfield'); Or,

Re: [fw-general] Upgrading to Zend Framework 1.9.0

2009-08-06 Thread Hector Virgen
One of the only issues I ran into when upgrading from 1.7.x to 1.8.2 was the deprecated autoloader (deprecated in 1.8). // Old code Zend_Loader::registerAutoloader(); // New code $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader-setFallbackAutoloader(true); Other than that, I ran

Re: [fw-general] Validate and Filter - default namespaces raising warnings

2009-08-04 Thread Hector Virgen
You may want to try suppressing the warnings: $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader-supressNotFoundWarnings(true); -- Hector On Tue, Aug 4, 2009 at 9:01 AM, Luiz Vitor prowler...@gmail.com wrote: I apologize for sending this message again, but does anyone know how

Re: [fw-general] Zend_Form_Element_Select - Set selected value from DB row.

2009-08-04 Thread Hector Virgen
You need to use the value of the select option, not the label. So your $data array should look like this: $data = array( 'id' = $row-GetId(), 'machinetype'= 3, 'name' = $row-getName(), 'descr' = $row-getDescr() );

Re: [fw-general] Zend_Validate_Db_NoRecordExists

2009-08-03 Thread Hector Virgen
It may be better to extend Zend_Validate_Db_NoRecordExists to create your own UniqueUsername validator. This would allow you to pre-define the table/field properties and add a new method like setCurrentUsername(). The validator could then check if the username had been changed and, if so, query

Re: [fw-general] Unexpected session exception with Zend_Application_Resource_Session

2009-07-31 Thread Hector Virgen
I think you're missing a forward slash: resources.session.save_path = APPLICATION_PATH /../data/session/ I'd also double-check that the folder is writable by php/apache. -- Hector On Fri, Jul 31, 2009 at 8:34 AM, Lucas Corbeaux lucas.corbe...@gmail.comwrote: Hi there, I have a strange

[fw-general] Zend_Form: Adding elements to an existing display group

2009-07-30 Thread Hector Virgen
Hello, I am having some trouble with Zend_Form and display groups (ZF 1.8.2). I want to add an existing form element to an existing display group within the same form, but when I call $displayGroup-addElement($element), the element is re-added to the form, causing it to be rendered twice (once in

Re: [fw-general] Disabling a radio option in Zend_Form

2009-07-30 Thread Hector Virgen
You can pass in a disable option when you create the element. It accepts an array of radio IDs to disable, or true to disable them all. $form-addElement('radio', 'foo', array( 'multiOptions' = array( 1 = 'one', 2 = 'two', 3 = 'three' ), 'disable' = array(3) // disables only radio 3 )); -- Hector

Re: [fw-general] Disabling a radio option in Zend_Form

2009-07-30 Thread Hector Virgen
that already exists. I am trying to alter it after it has already created but the 'disable' option doesn't appear to help me in this case. I might just remove the option instead and leave a message indicating the fact. Thanks though, Chris Hector Virgen wrote: You can pass in a disable option when

Re: [fw-general] Re: Zend_Form: Adding elements to an existing display group

2009-07-30 Thread Hector Virgen
enough to know if the element already belongs to the form, but the workaround above isn't too bad. -- Hector On Thu, Jul 30, 2009 at 1:03 PM, Colin Guthrie gm...@colin.guthr.ie wrote: 'Twas brillig, and Hector Virgen at 30/07/09 18:56 did gyre and gimble: Hello, I am having some trouble

Re: [fw-general] Re: Zend_Form: Adding elements to an existing display group

2009-07-30 Thread Hector Virgen
in the values, but they are rendered on the page. Any ideas what might be going on? -- Hector Sent from Temecula, California, United States On Thu, Jul 30, 2009 at 1:19 PM, Hector Virgen djvir...@gmail.com wrote: Thanks, Colin. After some tinkering I ended up doing something similar to your

Re: [fw-general] Re: Zend_Form: Adding elements to an existing display group

2009-07-30 Thread Hector Virgen
://framework.zend.com/issues/browse/ZF-3496 http://framework.zend.com/issues/browse/ZF-3496Thanks for your help, Colin. :) -- Hector Sent from Temecula, California, United States On Thu, Jul 30, 2009 at 2:55 PM, Colin Guthrie gm...@colin.guthr.ie wrote: 'Twas brillig, and Hector Virgen at 30/07

Re: [fw-general] encoding Zend_form UTF-8 to ISO...

2009-07-29 Thread Hector Virgen
Zend_Form uses the view from the action controller's view renderer by default. Forgot to send to list :) -- If you're using the new Zend_Application, you can add this line to your application.ini: resources.view.encoding = ISO-8859-1 Or, you can manually set the view early in your application:

Re: [fw-general] Zend_Form with elements having array names

2009-07-29 Thread Hector Virgen
Do you need multiple text inputs that post as an array? You could create a multiText form element that extends Zend_Form_Element_Multi. Take a look at Zend_Form_Element_MultiRadio to see how it works. Yesterday I had to create a series of checkboxes that were built to look like a navigation tree

Re: [fw-general] getting to the bootstrap instance

2009-07-29 Thread Hector Virgen
I believe the front controller has a reference to the bootstrap in its params: $bootstrap = Zend_Controller_Front::getInstance()-getParam('bootstrap'); -- Hector On Wed, Jul 29, 2009 at 1:28 PM, B. Kamer p...@bushbaby.nl wrote: Hi, I am unsure if and how I can get an instance to a

[fw-general] Re: [fw-auth] Re: [fw-general] Problem with Zend_Acl

2009-06-15 Thread Hector Virgen
Try registering your actual App_User and App_GameSheet objects with your ACL instead of generic role/resource objects. Change this: $acl-addRole(new Zend_Acl_Role('editor')); $acl-add(new Zend_Acl_Resource('App_GameSheet'); to this: $acl-addRole(new App_User()); $acl-add(new App_GameSheet());

[fw-general] Re: [fw-mvc] ViewRenderer Script Path BUG

2008-11-13 Thread Hector Virgen
I think it would make more sense to remove old paths from the stack rather than push the stack with duplicates. Maybe it would be better if each module had its own view script stack? That way they wouldn't interfere with each other at all. -Hector On Thu, Nov 13, 2008 at 10:11 AM, Arthur M.

[fw-general] Zend_Dom_Query and XML

2008-11-10 Thread Hector Virgen
I am using the 1.6.2 branch of ZF, and I'm having trouble using Zend_Dom_Query with a simple XML file. I have followed the example from http://framework.zend.com/manual/en/zend.dom.query.html#zend.dom.query.methods.zenddomquerybut it doesn't seem to be working for me. Am I doing something wrong?

[fw-general] Re: Zend_Dom_Query and XML

2008-11-10 Thread Hector Virgen
I just tried the same thing with Zend_Dom_Query::queryXpath(), and I got the same results: $listings = $dom-queryXpath('/Manifest/Listings/ListingDocument'); Maybe there is something wrong with my XML? -Hector On Mon, Nov 10, 2008 at 8:53 PM, Hector Virgen [EMAIL PROTECTED] wrote: I am using

[fw-general] StopWords with Zend_Search_Lucene

2008-09-29 Thread Hector Virgen
What should the array of stop words be set up like when being passed to Zend_Search_Lucene_Analysis_TokenFilter_StopWords? The online manual says to use an array like this: $stopWords = array('a', 'an', 'at', 'the', 'and', 'or', 'is', 'am');

[fw-general] Re: [fw-mvc] Using the Dojo shipped with ZF 1.6.0 - Important Note

2008-09-10 Thread Hector Virgen
Thanks for the update! I have been using -f, which tests if a file exists, but I see now that using -s is better because it ensures the file exists andhas a filesize greater than zero. -Hector On Wed, Sep 10, 2008 at 11:30 AM, Matthew Weier O'Phinney [EMAIL PROTECTED]wrote: Greets -- A number

[fw-general] Re: [fw-webservices] Proposal suggested for a Zend_Feed_Reader

2008-07-30 Thread Hector Virgen
This is a good idea and I think you've covered all of the issues I've had with Zend_Feed, particularly with reading Slashdot's RSS feed (which I still have not been able to do). I like your caching idea. I'd like to be able to set a default cache as a static property (similar to

<    1   2   3   4   5