Re: [fw-general] autocomplete="off"

2009-11-04 Thread Anders Gunnarsson

It doesn't display a list, it is just pre-filled when you enter the page.
I have chosen "save this password" when loggin in,
but when enterning "edit profile" the field for "new password" if filled 
with the password I'm using to log in.


I will now try the autocomplete switch.




Hector Virgen skrev:
I've never seen a password field support autocomplete. What does it 
do? Does it show a list of recently typed passwords so you can select 
one? I thought this feature was only available on inputs of type "text".


--
Hector


On Tue, Nov 3, 2009 at 11:12 AM, Jurian Sluiman 
mailto:subscr...@juriansluiman.nl>> wrote:


The autocomplete attribute is an unsupported one, but introduced
by Microsoft. Now all common browsers supports the autocomplete
attribute, though it's still not in the official specification
(afaik).


For elements, all kind of attributes can be set with an option.
Inside your form::init() method:
$this->addElement('password', 'password', array(
'label' => 'Your password',
'autocomplete' => 'off'
));


Regards, Jurian
--
Jurian Sluiman
Soflomo.com


Op Tuesday 03 November 2009 20:06:54 schreef Hector Virgen:

> Do input type="password" fields support autocomplete?
>
> --
> Hector
>
> On Tue, Nov 3, 2009 at 11:02 AM, Anders Gunnarsson
mailto:and...@metropolis.se>>wrote:
> > How do I add /
> > autocomplete/="off"
> >
> > To a password field in zend_form?
> >
> > Anders




[fw-general] autocomplete="off"

2009-11-03 Thread Anders Gunnarsson

How do I add /
autocomplete/="off"

To a password field in zend_form?

Anders


[fw-general] css class to option tags

2009-10-28 Thread Anders Gunnarsson

Hi

I'm creating a select box, and adding the options using "addMultiOptions".

How can I set CSS Class to the option-tags?


  1
  2
  3


regards
Anders


Re: [fw-general] How do you decorate MultiCheckbox elements?

2009-10-26 Thread Anders Gunnarsson

Old subject, but did you ever solve this?

I have the same problem




Philip G skrev:
Simple question, I can't for the life of me figure out how you would 
decorate checkbox elements. There seems to be options to do all sorts 
of things, but individual checkbox elements?


I need to setup a form label within a  tag and then each element 
within a  tag surrounded by a full . I figured out the  
and . But each checkbox/label around surrounded by ? (or 
even div if I must).


---
Philip
g...@gpcentre.net 
http://www.gpcentre.net/


[fw-general] Checkbox validation disappears

2009-10-21 Thread Anders Gunnarsson


What is the best way to validate that a checkbox is filled? (A Terms 
checkbox)


I have not been able to add a regular validation.
And if I simply look at the value and add the error myself
$form->termsBox->addError('Required');

The error disappears when validationg the whole form
$form->isValid($_POST)

regards
Anders


[fw-general] disable escaping

2009-10-16 Thread Anders Gunnarsson

How do i disable escaping in zend_form?

I have found a $form->getView()->setEscape() but only found two settings 
"htmlspecialchars" and "stripslashes".

I saw something about "noEscape" in a forum, but that gives me an error.

regards
Anders

/
/


[fw-general] Removing BR from FormMultiCheckbox

2009-10-08 Thread Anders Gunnarsson


How do I remove the  between checkBoxes, using the "multiCheckbox" 
(Zend_Form_Element)?


Seems to be a rather unnecessary default anyway. I'd rather use css to 
handle the view.


regards
Anders


[fw-general] Session charing with Drupal

2009-10-02 Thread Anders Gunnarsson

I've got a site with ZF as base,
but have Drupal running in a sub folder.
example.com/ (ZF)
example.com/drupal-site/ (Drupal)

My problem is that I get different Sessions IDs in drupal pages
then I do in ZF pages.

I don't understand why, I thought in was php and apache itself that 
handled the session.


regards
Anders



Re: FW: [fw-general] Zend_Form_Element_MultiCheckbox values

2009-09-21 Thread Anders Gunnarsson

For those who get the same problem,
I solved it by populating the post again.

$form->populate($_POST);

It still feels like I'm doing something wrong,
but this works for now.



Anders Gunnarsson skrev:

Unfortunately that didn't help.

The $_POST gives me
['groups'] => Array ( [0] => 2 [1] => 3 [2] => 4 )

But $form->getValues() still gives me
['groups'] =>




Sergio Rinaudo skrev:


Hi,
I am not sure if this is your solution, but after you instanciate the 
form, try to set RegisterInArrayValidator to false



$form = new Your_Form(); // just an example
$form->groups->setRegisterInArrayValidator(false);

Give it a try.
Bye




> Date: Mon, 21 Sep 2009 16:58:15 +0200
> From: and...@metropolis.se
> To: fw-general@lists.zend.com
> Subject: [fw-general] Zend_Form_Element_MultiCheckbox values
>
> Hi
>
> My checked checkboxes are missing in the Post.
>
> I'm making checkboxes like this:
>
> $group = new Zend_Form_Element_MultiCheckbox('groups');
> $group->addMultiOption(1,'A');
> $group->addMultiOption(2,'B');
> $group->addMultiOption(3,'C');
> $form->addElement($group);
>
> They look good in the html, and when posted I can see "groups" as an
> array in $_POST,
> but just an empty string when looking in the
> $form->getValues()
>
> What do I need to do to make the checkboxes appere in 
$form->getValues() ?

>
> regards
> Anders


Preparati alla sfida all'ultima combinazione, gioca con Crosswire! 
<http://livesearch.games.msn.com/crosswire/default_it/>


Scarica Messenger gratis: comunica, divertiti e condividi 
rapidamente! <http://messenger.it/home_comunica.aspx>




Re: FW: [fw-general] Zend_Form_Element_MultiCheckbox values

2009-09-21 Thread Anders Gunnarsson

By the way, I'm using ZF version 1.8.3



Anders Gunnarsson skrev:

Unfortunately that didn't help.

The $_POST gives me
['groups'] => Array ( [0] => 2 [1] => 3 [2] => 4 )

But $form->getValues() still gives me
['groups'] =>




Sergio Rinaudo skrev:


Hi,
I am not sure if this is your solution, but after you instanciate the 
form, try to set RegisterInArrayValidator to false



$form = new Your_Form(); // just an example
$form->groups->setRegisterInArrayValidator(false);

Give it a try.
Bye




> Date: Mon, 21 Sep 2009 16:58:15 +0200
> From: and...@metropolis.se
> To: fw-general@lists.zend.com
> Subject: [fw-general] Zend_Form_Element_MultiCheckbox values
>
> Hi
>
> My checked checkboxes are missing in the Post.
>
> I'm making checkboxes like this:
>
> $group = new Zend_Form_Element_MultiCheckbox('groups');
> $group->addMultiOption(1,'A');
> $group->addMultiOption(2,'B');
> $group->addMultiOption(3,'C');
> $form->addElement($group);
>
> They look good in the html, and when posted I can see "groups" as an
> array in $_POST,
> but just an empty string when looking in the
> $form->getValues()
>
> What do I need to do to make the checkboxes appere in 
$form->getValues() ?

>
> regards
> Anders


Preparati alla sfida all'ultima combinazione, gioca con Crosswire! 
<http://livesearch.games.msn.com/crosswire/default_it/>


Scarica Messenger gratis: comunica, divertiti e condividi 
rapidamente! <http://messenger.it/home_comunica.aspx>




FW: [fw-general] Zend_Form_Element_MultiCheckbox values

2009-09-21 Thread Anders Gunnarsson

Unfortunately that didn't help.

The $_POST gives me
['groups'] => Array ( [0] => 2 [1] => 3 [2] => 4 )

But $form->getValues() still gives me
['groups'] =>




Sergio Rinaudo skrev:


Hi,
I am not sure if this is your solution, but after you instanciate the 
form, try to set RegisterInArrayValidator to false



$form = new Your_Form(); // just an example
$form->groups->setRegisterInArrayValidator(false);

Give it a try.
Bye




> Date: Mon, 21 Sep 2009 16:58:15 +0200
> From: and...@metropolis.se
> To: fw-general@lists.zend.com
> Subject: [fw-general] Zend_Form_Element_MultiCheckbox values
>
> Hi
>
> My checked checkboxes are missing in the Post.
>
> I'm making checkboxes like this:
>
> $group = new Zend_Form_Element_MultiCheckbox('groups');
> $group->addMultiOption(1,'A');
> $group->addMultiOption(2,'B');
> $group->addMultiOption(3,'C');
> $form->addElement($group);
>
> They look good in the html, and when posted I can see "groups" as an
> array in $_POST,
> but just an empty string when looking in the
> $form->getValues()
>
> What do I need to do to make the checkboxes appere in 
$form->getValues() ?

>
> regards
> Anders


Preparati alla sfida all'ultima combinazione, gioca con Crosswire! 



Scarica Messenger gratis: comunica, divertiti e condividi rapidamente! 



[fw-general] Zend_Form_Element_MultiCheckbox values

2009-09-21 Thread Anders Gunnarsson

Hi

My checked checkboxes are missing in the Post.

I'm making checkboxes like this:

$group = new Zend_Form_Element_MultiCheckbox('groups');
$group->addMultiOption(1,'A');
$group->addMultiOption(2,'B');
$group->addMultiOption(3,'C');
$form->addElement($group);

They look good in the html, and when posted I can see "groups" as an 
array in $_POST,

but just an empty string when looking in the
$form->getValues()

What do I need to do to make the checkboxes appere in $form->getValues() ?

regards
Anders


[fw-general] Setting different error controllers

2009-09-17 Thread Anders Gunnarsson

Hello

I have 4 different sets of controller directories

/application/admin
/default
/clinicians
/patients

All errors are now handled by
/application/default/controllers/ErrorController.php

How can I set it up to have 4 ErrorHandler?
Eg. An error in
www.example.com/patients/list/all
Should be handled by
/application/patients/controllers/ErrorController.php

I have not understood how to use
Zend_Controller_Plugin_ErrorHandler
for this problem


regards
Anders


[fw-general] Call to ZF from external php

2009-08-03 Thread Anders Gunnarsson


Is it possible to call my ZF actions from regular php?

I need to have a CMS (probably drupal) installation parallell to zend 
framework.
The pages made in the CMS need to show if I'm logged in to the site 
(based on ZF).


It's okey if the call only returns a string (but making curl-calls seems 
like an ugly sollution).


regards
Anders




[fw-general] Bulletin / discussion board

2009-07-28 Thread Anders Gunnarsson


Have you seen a good ZF based bullitin/discussion board?
Preferably open source

regards
Anders


[fw-general] design patterns / best practices for big site

2009-07-27 Thread Anders Gunnarsson

I've used Zend Framework for mid size sites,
but I'm now planning to use it for a much bigger one.

- Is there a good guide for design patterns and object oriented code in 
zend framework?


Some thoughts I'd like answers to:
- Where should I put classes that extend framework code?
- Where should I put classes and methods that I can use in both 
controllers, views and view helpers? (And what's the best way to do that?)
- Can I make a view helper or a view method that inherits $this ? (can 
be good for recurse-rendering trees etc)

- Best way to combine stored procedures, zend models and version control


regards
Anders


Re: [fw-general] prioritize controller before route

2009-02-11 Thread Anders Gunnarsson

Great, thanx. That worked.

Though that mean I have to make routes for all controllers
that otherwise would default to.

Is it best to put all routes in the bootstrap file index.php?



Brenton Alker skrev:

Anders Gunnarsson wrote:
  

Hi

I have made a route that points
domain.com/username
to a controller "users" with action "view".


But at the same time, I would like existing controllers to
be prioritized before the routing.
Eg
domain.com/videos

should point to the controller "videos" not the username.

Is this possible?

regards
Anders



The router will stop at the first route it finds that matches, and
according to the docs
(http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.basic)
they are matched in reverse order.

So as long as your "videos" route is defined after your "username"
route, you should be fine.

  


[fw-general] prioritize controller before route

2009-02-11 Thread Anders Gunnarsson

Hi

I have made a route that points
domain.com/username
to a controller "users" with action "view".


But at the same time, I would like existing controllers to
be prioritized before the routing.
Eg
domain.com/videos

should point to the controller "videos" not the username.

Is this possible?

regards
Anders


[fw-general] forums

2008-10-18 Thread Anders Gunnarsson

Hi

Is there any forum plugins / classes for writing forums?

Something like phpbb or phorum, but integrated with zend framework?

g


[fw-general] Rewrite Rule

2008-09-02 Thread Anders Gunnarsson

Hello

I'm not very used to rewrite rules, but I'd like to map this request
/event/xxx
to
/handle/view?event=xxx

I'm guessing I could create a /event/ directory an use a .htaccess inside,
that overrules the .htaccess in the root.

regards
Anders



Re: AW: [fw-general] Re: sql lower encoding

2008-06-27 Thread Anders Gunnarsson

Okey, thanks.

Is it also possible to do this using a config.ini file?




Stefan Gehrig wrote:

Hi Anders,

you can use the following to create the adapter if you're using the
PDO-adapters:

$db=Zend_Db::factory('Pdo_Mysql', array(
'host'   => 'localhost',
  'username'   => 'user',
  'password'   => 'pa$$w0rd',
  'dbname' => 'database',
  'driver_options' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'
)
));

This ensures that the SET-NAMES-Command is issued with every reconnect of
the underlying adapter.

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: Anders Gunnarsson [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 27. Juni 2008 09:10

An: fw-general@lists.zend.com
Betreff: Re: [fw-general] Re: sql lower encoding

The encoding problems ended when setting
$this->query('SET NAMES utf8');
at both insert and select.

Is there a better way to do this? At db-connection time?




Johannes Schill wrote:
  
If you're inserting with a form, you can always try adding 
accept-charset="UTF-8" on your form-tag.


Johannes 



2008/6/26, Anders Gunnarsson <[EMAIL PROTECTED] 
<mailto:[EMAIL PROTECTED]>>:


I found out that my problem must be on inserting.

How can I be sure that I'm inserting with utf8?

If I insert ÅÄÖ in phpmyadmin, they are inserted correctly,
but not when inserting from my own forms.

I've tried
    $this->query('SET NAMES utf8');
before inserting, but it doesn't seem to help.

can I use config.ini to specify utf8?
and would that help?

regards
Anders


Anders Gunnarsson wrote:

Hi!

I'm doing a SQL LIKE() with non-western characters.

SELECT * FROM users WHERE LOWER(userName) LIKE '%'.
mb_strtolower($searchStr, mb_detect_encoding($searchStr)) .'%'

The php is converting the characters right,
but the SQL isn't.

I'm using mysql 5.0.38
and utf8_unicode_ci

Maybe somebody has an other sollution to searching
case-insensitive with non-western characters?







  


Re: [fw-general] Re: sql lower encoding

2008-06-27 Thread Anders Gunnarsson

The encoding problems ended when setting
$this->query('SET NAMES utf8');
at both insert and select.

Is there a better way to do this? At db-connection time?




Johannes Schill wrote:


If you're inserting with a form, you can always try adding 
accept-charset="UTF-8" on your form-tag.


Johannes 



2008/6/26, Anders Gunnarsson <[EMAIL PROTECTED] 
<mailto:[EMAIL PROTECTED]>>:


I found out that my problem must be on inserting.

How can I be sure that I'm inserting with utf8?

If I insert ÅÄÖ in phpmyadmin, they are inserted correctly,
but not when inserting from my own forms.

I've tried
$this->query('SET NAMES utf8');
before inserting, but it doesn't seem to help.

can I use config.ini to specify utf8?
and would that help?

regards
Anders


Anders Gunnarsson wrote:

Hi!

I'm doing a SQL LIKE() with non-western characters.

SELECT * FROM users WHERE LOWER(userName) LIKE '%'.
mb_strtolower($searchStr, mb_detect_encoding($searchStr)) .'%'

The php is converting the characters right,
but the SQL isn't.

I'm using mysql 5.0.38
and utf8_unicode_ci

Maybe somebody has an other sollution to searching
case-insensitive with non-western characters?





[fw-general] Re: sql lower encoding

2008-06-26 Thread Anders Gunnarsson

I found out that my problem must be on inserting.

How can I be sure that I'm inserting with utf8?

If I insert ÅÄÖ in phpmyadmin, they are inserted correctly,
but not when inserting from my own forms.

I've tried
$this->query('SET NAMES utf8');
before inserting, but it doesn't seem to help.

can I use config.ini to specify utf8?
and would that help?

regards
Anders


Anders Gunnarsson wrote:

Hi!

I'm doing a SQL LIKE() with non-western characters.

SELECT * FROM users WHERE LOWER(userName) LIKE '%'. 
mb_strtolower($searchStr, mb_detect_encoding($searchStr)) .'%'


The php is converting the characters right,
but the SQL isn't.

I'm using mysql 5.0.38
and utf8_unicode_ci

Maybe somebody has an other sollution to searching case-insensitive 
with non-western characters?





Re: [fw-general] Zend_mail debug

2008-06-03 Thread Anders Gunnarsson

I'm using an external SMTP server (from my ISP, smtp.bredband.net),
so I can't check any logs.

Is it possible to debug on that?



Ben Scholzen 'DASPRiD' wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

If you use the default adapter (nothing set), then PHP's mail() function
is used, which will only return true or false, so there is nothing you
could debug. I suggest that you check the log of the mail server.

Anders Gunnarsson schrieb:
  

Hi

Is there a way to debug Zend_mail?

I'm not getting any errors, but I'm not receiving any email.

Actually I can send emails while I'm running the page through localhost,
but not while going through the www-adress.

I'd like to debug the whole handshake procedure and see where it fails.

regards
Anders



- --
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIRCtX0HfT5Ws789ARAgzeAJ9QykrQfMMfY9KZDRkn2vF9SC2cWQCfRTlO
F55VdxMCpsbMDJGz1+U01ko=
=IPRR
-END PGP SIGNATURE-

  


[fw-general] Zend_mail debug

2008-06-02 Thread Anders Gunnarsson

Hi

Is there a way to debug Zend_mail?

I'm not getting any errors, but I'm not receiving any email.

Actually I can send emails while I'm running the page through localhost,
but not while going through the www-adress.

I'd like to debug the whole handshake procedure and see where it fails.

regards
Anders


Re: [fw-general] using session id in url

2008-04-26 Thread Anders Gunnarsson

Well, I've tried that (actually using the zend framework)

if($_REQUEST["PHPSESSID"]){
   Zend_Session::setId($_REQUEST["PHPSESSID"]);
}

but this doesn't seem to be working.
If I take the session id from one browser (firefox) and then try to set 
it in another browser (IE) like:

http://localhost:82/home?PHPSESSID=f2281c38e9a26daba9c486c7e45704d5

IE gets the same cookie, but I'm not logged in (as I was in firefox with 
the same session id).


If I try to request
http://localhost:82/home?PHPSESSID=xxx
in firefox (while logged in), it's not changing the session id to xxx, 
and therefore I'm still logged in.


Am I using i wrong?





Christer Edvartsen wrote:
You could use the session_id function to set the session id. Check out 
the php manual:


http://www.php.net/session_id

Anders Gunnarsson wrote:

Hi

I'd like to send the session id as a url request (on a single page),
instead of using the cookie.
(Firefox looses the cookie when uploading files with flash)
Something like:

if($_GET["PHPSESSID"]){
   // set session to $_GET["PHPSESSID"]
}
session_start()

is this possible?

regards
Anders




[fw-general] using session id in url

2008-04-26 Thread Anders Gunnarsson

Hi

I'd like to send the session id as a url request (on a single page),
instead of using the cookie.
(Firefox looses the cookie when uploading files with flash)
Something like:

if($_GET["PHPSESSID"]){
   // set session to $_GET["PHPSESSID"]
}
session_start()

is this possible?

regards
Anders


Re: [fw-general] fetchAll differens

2007-12-10 Thread Anders Gunnarsson

Thanks, that worked fine!

A performance question then:
Is there a better/faster way for only accessing data then using rowsets?
I usually only need raw data access.

Can I make another type of fetchAll, that skips all Table Data Gateway 
pattern - stuff,

and save computing time/power?





Matthew Weier O'Phinney wrote:

-- Anders Gunnarsson <[EMAIL PROTECTED]> wrote
(on Monday, 10 December 2007, 09:46 AM +0100):
  
When I use the fetchAll-method inside a modelclass (MessageThreads) like 
this:

$this->fetchAll();
I get a Zend_Db_Table_Rowset Object

But if I do this:
$this->getAdapter()->query("SELECT * FROM messageThreads")->fetchAll();
I just get an associative Array (but with the same data)

Can I get them to return the same?



You can always cast the results of the latter call to a
Zend_Db_Table_Rowset:

return new $this->_rowsetClass(array(
'table'=> $this,
'rowClass' => $this->_rowClass,
'data' => $this->getAdapter()->query("SELECT * FROM 
messageThreads")->fetchAll(),
'stored'   => true
));


  

If I set the examples to a view-object I can loop both,
but the second gives me an error "Trying to get property of non-object",
when getting the values.



Right -- because calling fetchAll() on a zend_db_adapter object returns
an associative array; db adapters are meant for basically raw data
access. Zend_Db_Table works differently as it is implementing a Table
Data Gateway pattern, which returns rowsets of Row Data Gateways --
which allow you to write business logic surrounding returned results and
inserting/updating results.

  


[fw-general] fetchAll differens

2007-12-10 Thread Anders Gunnarsson

Hi!

When I use the fetchAll-method inside a modelclass (MessageThreads) like 
this:

$this->fetchAll();
I get a Zend_Db_Table_Rowset Object

But if I do this:
$this->getAdapter()->query("SELECT * FROM messageThreads")->fetchAll();
I just get an associative Array (but with the same data)

Can I get them to return the same?

If I set the examples to a view-object I can loop both,
but the second gives me an error "Trying to get property of non-object",
when getting the values.


regards
Anders