Re: [fw-general] Zend_Db_Table How best to associate an object with a db table?

2009-04-27 Thread Sudheer Satyanarayana

J DeBord wrote:
This may be partially a general oop question, but I hope someone can 
give me some advice.


If you want to build a User object, what is the best way to store it's 
attributes? Would a user object extend a Zend_Db_Table? Would you code 
a User class and have it interact with a UserTable extends 
Zend_Db_Table class? Can anyone provide a general example of code 
please? Or any advice? Books to read, sites to visit, etc...



Personally, I prefer not to extend Zend_Db_Table for models.

Matthew has written about it previously. 
http://weierophinney.net/matthew/archives/202-Model-Infrastructure.html 
You should follow Matthew's blog for tutorials, news and insight about 
Zend Framework. There's also a free book available on ZF - 
http://www.survivethedeepend.com/



--

With warm regards,
Sudheer. S
Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, 
Personal: http://sudheer.net



Re: [fw-general] how to know which controller and action is being called

2009-04-27 Thread Sudheer Satyanarayana

prado wrote:

BTW Vince

How can i use this below straight from the view without putting in a
variable from the controller?

cheers
  

Access the request object. And then you can read the controller name:
$request-getControllerName();

This link might help - 
http://techchorus.net/how-access-request-object-any-part-your-application



--

With warm regards,
Sudheer. S
Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, 
Personal: http://sudheer.net



Re: [fw-general] how to know which controller and action is being called

2009-04-27 Thread Vadim Gabriel
Hey,

That will not give him the ability to access the request object in his view
script. Unless he would like to get the front controllers instance directly
inside the view script file.

Vince.

On Mon, Apr 27, 2009 at 9:14 AM, Sudheer Satyanarayana 
sudhee...@binaryvibes.co.in wrote:

 prado wrote:

 BTW Vince

 How can i use this below straight from the view without putting in a
 variable from the controller?

 cheers


 Access the request object. And then you can read the controller name:
 $request-getControllerName();

 This link might help -
 http://techchorus.net/how-access-request-object-any-part-your-application


 --

 With warm regards,
 Sudheer. S
 Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net,
 Personal: http://sudheer.net




-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


Re: [fw-general] how to know which controller and action is being called

2009-04-27 Thread Sudheer Satyanarayana

Vadim Gabriel wrote:

Hey,

That will not give him the ability to access the request object in his 
view script. Unless he would like to get the front controllers 
instance directly inside the view script file.


True. I have never encountered a situation where I had to access the 
request object in the view script.


Pradosh,

If you describe us what exactly you are trying to do, we will be able to 
provide proper directions. My previous reply was for your information 
purpose only.




--

With warm regards,
Sudheer. S
Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, 
Personal: http://sudheer.net



Re: [fw-general] Zend_Db_Table How best to associate an object with a db table?

2009-04-27 Thread Karol Grecki

Jason,

I suggest you use Zend_Db_Table to retrieve corresponding row and store it
as a member variable (Zend_Db_Table_Row). You can expose its properties
using __get/set for ease of use. Extending Zend_Db_Table would be a bad
idea.

Karol


J DeBord wrote:
 
 This may be partially a general oop question, but I hope someone can give
 me
 some advice.
 
 If you want to build a User object, what is the best way to store it's
 attributes? Would a user object extend a Zend_Db_Table? Would you code a
 User class and have it interact with a UserTable extends Zend_Db_Table
 class? Can anyone provide a general example of code please? Or any advice?
 Books to read, sites to visit, etc...
 
 Thanks a lot.
 
 Jason DEBORD
 Limoges, France
 
 http://www.jasondebord.net/
 
 

-- 
View this message in context: 
http://www.nabble.com/Zend_Db_Table-How-best-to-associate-an-object-with-a-db-table--tp23245110p23251895.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Navigation

2009-04-27 Thread monk.e.boy

Zend_Navigation: The documentation is a little confusing. Has anyone a simple
little tutorial or example of how to make breadcrumbs?

Thanks!!

monk.e.boy
-- 
View this message in context: 
http://www.nabble.com/Zend_Navigation-tp23251940p23251940.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Db_Table How best to associate an object with a db table?

2009-04-27 Thread J DeBord
Karol, I thought about using Zend_Db_Table_Row somehow. Would the Row object
become a variable of the user class? Then if the User's attributes change,
you would actually be changing the attributes of the Row object? This sounds
great, I just don't have enough experience to know if this is the best way
to go about it.

Thanks a lot.

J

On Mon, Apr 27, 2009 at 10:13 AM, Karol Grecki kgre...@gmail.com wrote:


 Jason,

 I suggest you use Zend_Db_Table to retrieve corresponding row and store it
 as a member variable (Zend_Db_Table_Row). You can expose its properties
 using __get/set for ease of use. Extending Zend_Db_Table would be a bad
 idea.

 Karol


 J DeBord wrote:
 
  This may be partially a general oop question, but I hope someone can give
  me
  some advice.
 
  If you want to build a User object, what is the best way to store it's
  attributes? Would a user object extend a Zend_Db_Table? Would you code a
  User class and have it interact with a UserTable extends Zend_Db_Table
  class? Can anyone provide a general example of code please? Or any
 advice?
  Books to read, sites to visit, etc...
 
  Thanks a lot.
 
  Jason DEBORD
  Limoges, France
 
  http://www.jasondebord.net/
 
 

 --
 View this message in context:
 http://www.nabble.com/Zend_Db_Table-How-best-to-associate-an-object-with-a-db-table--tp23245110p23251895.html
 Sent from the Zend Framework mailing list archive at Nabble.com.




Re: [fw-general] Zend_Db_Table How best to associate an object with a db table?

2009-04-27 Thread J DeBord
Thanks Cem,

I am going to look at Zend_Db_Table_* classes for sure. I appreciate the
guidance.

And for everyone, I just read this article of Matthew's
http://weierophinney.net/matthew/archives/202-Model-Infrastructure.html and
it is awesome. Thanks Matthew.

On Mon, Apr 27, 2009 at 12:58 PM, Cem Derin c...@wysiwyg.de wrote:

 Zend_Db_Table (respective any inherited class) represents all users (the
 full table). Zend_Db_Table_Row represents a single user (a single record).

 Thats how I use the Zend_Db_Table_*-Classes (and I extend them massively
 without any problem).

 Cheers,

 Cem

 J DeBord schrieb:

 Karol, I thought about using Zend_Db_Table_Row somehow. Would the Row
 object become a variable of the user class? Then if the User's attributes
 change, you would actually be changing the attributes of the Row object?
 This sounds great, I just don't have enough experience to know if this is
 the best way to go about it.

 Thanks a lot.

 J

 On Mon, Apr 27, 2009 at 10:13 AM, Karol Grecki kgre...@gmail.commailto:
 kgre...@gmail.com wrote:


Jason,

I suggest you use Zend_Db_Table to retrieve corresponding row and
store it
as a member variable (Zend_Db_Table_Row). You can expose its
properties
using __get/set for ease of use. Extending Zend_Db_Table would be
a bad
idea.

Karol


J DeBord wrote:

 This may be partially a general oop question, but I hope someone
can give
 me
 some advice.

 If you want to build a User object, what is the best way to
store it's
 attributes? Would a user object extend a Zend_Db_Table? Would
you code a
 User class and have it interact with a UserTable extends
Zend_Db_Table
 class? Can anyone provide a general example of code please? Or
any advice?
 Books to read, sites to visit, etc...

 Thanks a lot.

 Jason DEBORD
 Limoges, France

 http://www.jasondebord.net/



--
View this message in context:

 http://www.nabble.com/Zend_Db_Table-How-best-to-associate-an-object-with-a-db-table--tp23245110p23251895.html
Sent from the Zend Framework mailing list archive at Nabble.com.






[fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread holografix .
Hi

I have an application developed with ZF 1.7 and it works fine up to ZF
1.7.8. After update developpment box to ZF to latest trunk version,
starting to get notices about Zend_Loader::registerAutoload(), saying it's
deprecated and will be removed in 2.0.0.
This application follows ZF directory structure and it registers a front
controller plugin where resources are initialized.

New code in bootstrap.php:

require_once 'Zend/Loader/Autoloader.php';

$loader =
Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader(true);
$loader-registerNamespace('ZendExt_');

$front = Zend_Controller_Front::getInstance();
$front-registerPlugin(new ZendExt_Plugin_Initialize(APPLICATION_ENV));

Resources are initialized but have some problems with loading a form.

When opening the application, if one is not logged in, it redirects to
index/login (Form_Login.php)
http://application = http://application/login

Forms are in a dir called forms under application dir.
In login action I have this code

public function loginAction()
{
include APPLICATION_PATH . /forms/Form_Login.php;

$loginForm = new Form_Login();

... validation and authentication
}

The output is wrong

form action=/login method=post id=formlogin name=formlogin
fieldset
legendLogin/legend
form id=username/form
form id=password/form
form id=submit/form
/fieldset
/form


With Zend_Loader there are no problems.
How can I fix the problem ?

Cheers,
holo


Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread Christopher Östlund
What's up with the static singleton instance, is it a design goal for 2.0 to
add more static stuff?

/C

On Mon, Apr 27, 2009 at 3:34 PM, holografix . hologra...@gmail.com wrote:

 Hi

 I have an application developed with ZF 1.7 and it works fine up to ZF
 1.7.8. After update developpment box to ZF to latest trunk version,
 starting to get notices about Zend_Loader::registerAutoload(), saying it's
 deprecated and will be removed in 2.0.0.
 This application follows ZF directory structure and it registers a front
 controller plugin where resources are initialized.

 New code in bootstrap.php:

 require_once 'Zend/Loader/Autoloader.php';

 $loader =
 Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader(true);
 $loader-registerNamespace('ZendExt_');

 $front = Zend_Controller_Front::getInstance();
 $front-registerPlugin(new ZendExt_Plugin_Initialize(APPLICATION_ENV));

 Resources are initialized but have some problems with loading a form.

 When opening the application, if one is not logged in, it redirects to
 index/login (Form_Login.php)
 http://application = http://application/login

 Forms are in a dir called forms under application dir.
 In login action I have this code

 public function loginAction()
 {
 include APPLICATION_PATH . /forms/Form_Login.php;

 $loginForm = new Form_Login();

 ... validation and authentication
 }

 The output is wrong

 form action=/login method=post id=formlogin name=formlogin
 fieldset
 legendLogin/legend
 form id=username/form
 form id=password/form
 form id=submit/form
 /fieldset
 /form


 With Zend_Loader there are no problems.
 How can I fix the problem ?

 Cheers,
 holo



Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread Matthew Weier O'Phinney
-- Christopher Östlund christopher.oestl...@gmail.com wrote
(on Monday, 27 April 2009, 04:37 PM +0200):
 Yeah, I get the purpose of the implementation. I just thought that for 2.0 a
 more Dependency Injection friendly path would be the choice.

There are a few places where singletons make sense. An autoloader is one
of those places, as those affect the entire application.

 2009/4/27 holografix . hologra...@gmail.com
 
 Hi
 From manual:
 
 Zend_Loader_Autoloader implements a singleton, making it unversally
 accessible.
 This provides the ability to register additional autoloaders from anywhere
 in your code as necessary.
  
 Cheers
 holo
  
 2009/4/27 Christopher Östlund christopher.oestl...@gmail.com
 
 
 What's up with the static singleton instance, is it a design goal for
 2.0 to add more static stuff?
 
 /C
 
 
 On Mon, Apr 27, 2009 at 3:34 PM, holografix . hologra...@gmail.com
 wrote:
 
 Hi
 
 I have an application developed with ZF 1.7 and it works fine up 
 to
 ZF 1.7.8. After update developpment box to ZF to latest trunk
 version,
 starting to get notices about Zend_Loader::registerAutoload(),
 saying it's deprecated and will be removed in 2.0.0.
 This application follows ZF directory structure and it registers a
 front controller plugin where resources are initialized.
 
 New code in bootstrap.php:
  
 require_once 'Zend/Loader/Autoloader.php';
 
 $loader = Zend_Loader_Autoloader::getInstance()-
 setFallbackAutoloader(true);
 $loader-registerNamespace('ZendExt_');
 
 $front = Zend_Controller_Front::getInstance();
 $front-registerPlugin(new ZendExt_Plugin_Initialize
 (APPLICATION_ENV));
 
 Resources are initialized but have some problems with loading a
 form.
 
 When opening the application, if one is not logged in, it 
 redirects
 to index/login (Form_Login.php)
 http://application = http://application/login
 
 Forms are in a dir called forms under application dir.
 In login action I have this code
 
 public function loginAction()
 {
     include APPLICATION_PATH . /forms/Form_Login.php;
 
     $loginForm = new Form_Login();
    
     ... validation and authentication
 }   
 
 The output is wrong
 
 form action=/login method=post id=formlogin name=
 formlogin
 fieldset
     legendLogin/legend   
     form id=username/form   
     form id=password/form   
     form id=submit/form
 /fieldset
 /form
 
 
 With Zend_Loader there are no problems.
 How can I fix the problem ?
 
 Cheers,
 holo
 
 
 
 
 
 

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread Matthew Weier O'Phinney
-- holografix . hologra...@gmail.com wrote
(on Monday, 27 April 2009, 02:34 PM +0100):
 I have an application developed with ZF 1.7 and it works fine up to ZF 1.7.8.
 After update developpment box to ZF to latest trunk version,
 starting to get notices about Zend_Loader::registerAutoload(), saying it's
 deprecated and will be removed in 2.0.0.
 This application follows ZF directory structure and it registers a front
 controller plugin where resources are initialized.
 
 New code in bootstrap.php:
  
 require_once 'Zend/Loader/Autoloader.php';
 
 $loader = Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader(true);
 $loader-registerNamespace('ZendExt_');
 
 $front = Zend_Controller_Front::getInstance();
 $front-registerPlugin(new ZendExt_Plugin_Initialize(APPLICATION_ENV));
 
 Resources are initialized but have some problems with loading a form.
 
 When opening the application, if one is not logged in, it redirects to index/
 login (Form_Login.php)
 http://application = http://application/login
 
 Forms are in a dir called forms under application dir.
 In login action I have this code
 
 public function loginAction()
 {
 include APPLICATION_PATH . /forms/Form_Login.php;
 
 $loginForm = new Form_Login();

 ... validation and authentication
 }   
 
 The output is wrong
 
 form action=/login method=post id=formlogin name=formlogin
 fieldset
 legendLogin/legend   
 form id=username/form   
 form id=password/form   
 form id=submit/form
 /fieldset
 /form
 
 
 With Zend_Loader there are no problems.
 How can I fix the problem ?

Use a module autoloader:

$module = new Zend_Application_Module_Autoloader(array(
'namespace' = '',
'basePath'  = APPLICATION_PATH . '/forms',
));

Then make sure your form is in the file:

APPLICATION_PATH/
forms/
Login.php

and contains the clas 'Form_Login'.

You can do that anywhere -- your bootstrapping code is probably the best
place, however. Once you have, you will not need to do an
include/include_once to get your form -- just 'new Form_Login()'.

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread Bart McLeod


*Notice*: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 
1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead 
in *E:\ZendFramework\library\Zend\Loader.php* on line *207*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


*Notice*: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 
and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in 
*E:\ZendFramework\library\Zend\Loader.php* on line *186*


What about Backwards Compatibility? This doesn't look good for sure. 
Makes me think I should wrap the framework...


Bart

Matthew Weier O'Phinney schreef:

-- holografix . hologra...@gmail.com wrote
(on Monday, 27 April 2009, 02:34 PM +0100):
  

I have an application developed with ZF 1.7 and it works fine up to ZF 1.7.8.
After update developpment box to ZF to latest trunk version,
starting to get notices about Zend_Loader::registerAutoload(), saying it's
deprecated and will be removed in 2.0.0.
This application follows ZF directory structure and it registers a front
controller plugin where resources are initialized.

New code in bootstrap.php:
 
require_once 'Zend/Loader/Autoloader.php';


$loader = Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader(true);
$loader-registerNamespace('ZendExt_');

$front = Zend_Controller_Front::getInstance();
$front-registerPlugin(new ZendExt_Plugin_Initialize(APPLICATION_ENV));

Resources are initialized but have some problems with loading a form.

When opening the application, if one is not logged in, it redirects to index/
login (Form_Login.php)
http://application = http://application/login

Forms are in a dir called forms under application dir.
In login action I have this code

public function loginAction()
{
include APPLICATION_PATH . /forms/Form_Login.php;

$loginForm = new Form_Login();
   
... validation and authentication
}   


The output is wrong

form action=/login method=post id=formlogin name=formlogin
fieldset
legendLogin/legend   
form id=username/form   
form id=password/form   
form id=submit/form

/fieldset
/form


With Zend_Loader there are no problems.
How can I fix the problem ?



Use a module autoloader:

$module = new 

Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread holografix .
Hi
Thanks for the reply. I change the code with your suggestion but didn't fix
the problem
I forgot to tell that this dev box is Win Vista 32

In bootstrap.php:

$module = new Zend_Application_Module_Autoloader(array(
   'namespace' = '',
   'basePath'  = APPLICATION_PATH . '/forms'
 ));
*Warning*: include(C:\wwwroot\devapp\application/forms/forms//Login.php) [
function.include http://nortemedico/admin/function.include]: failed to
open stream: No such file or directory

I change 'basePath' from APPLICATION_PATH . '/forms' to APPLICATION_PATH

$module = new Zend_Application_Module_Autoloader(array(
   'namespace' = '',
   'basePath'  = APPLICATION_PATH
 ));
Renamed APPLICATION_PATH\forms\Form_Login.php to Login.php and removed the
include of this file in controller action.

The file is loaded but the output is the same:

form action=/login
  method=post
  id=formlogin
  name=loginform

fieldset
legendLogin/legend
form id=username/form
form id=password/form
form id=submit/form
/fieldset
/form

Cheers
holo
2009/4/27 Matthew Weier O'Phinney matt...@zend.com

 -- holografix . hologra...@gmail.com wrote
 (on Monday, 27 April 2009, 02:34 PM +0100):
   I have an application developed with ZF 1.7 and it works fine up to ZF
 1.7.8.
  After update developpment box to ZF to latest trunk version,
  starting to get notices about Zend_Loader::registerAutoload(), saying
 it's
  deprecated and will be removed in 2.0.0.
  This application follows ZF directory structure and it registers a front
  controller plugin where resources are initialized.
 
  New code in bootstrap.php:
 
  require_once 'Zend/Loader/Autoloader.php';
 
  $loader =
 Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader(true);
  $loader-registerNamespace('ZendExt_');
 
  $front = Zend_Controller_Front::getInstance();
  $front-registerPlugin(new ZendExt_Plugin_Initialize(APPLICATION_ENV));
 
  Resources are initialized but have some problems with loading a form.
 
  When opening the application, if one is not logged in, it redirects to
 index/
  login (Form_Login.php)
  http://application = http://application/login
 
  Forms are in a dir called forms under application dir.
  In login action I have this code
 
  public function loginAction()
  {
  include APPLICATION_PATH . /forms/Form_Login.php;
 
  $loginForm = new Form_Login();
 
  ... validation and authentication
  }
 
  The output is wrong
 
  form action=/login method=post id=formlogin name=formlogin
  fieldset
  legendLogin/legend
  form id=username/form
  form id=password/form
  form id=submit/form
  /fieldset
  /form
 
 
  With Zend_Loader there are no problems.
  How can I fix the problem ?

 Use a module autoloader:

$module = new Zend_Application_Module_Autoloader(array(
'namespace' = '',
'basePath'  = APPLICATION_PATH . '/forms',
));

 Then make sure your form is in the file:

APPLICATION_PATH/
forms/
Login.php

 and contains the clas 'Form_Login'.

 You can do that anywhere -- your bootstrapping code is probably the best
 place, however. Once you have, you will not need to do an
 include/include_once to get your form -- just 'new Form_Login()'.

 --
 Matthew Weier O'Phinney
 Project Lead| matt...@zend.com
 Zend Framework  | http://framework.zend.com/



Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread Matthew Weier O'Phinney
-- Bart McLeod mcl...@spaceweb.nl wrote
(on Monday, 27 April 2009, 05:09 PM +0200):
 Notice: Zend_Loader::Zend_Loader::autoload is deprecated as of 1.8.0 and will
 be removed with 2.0.0; use Zend_Loader_Autoloader instead in E:\ZendFramework\
 library\Zend\Loader.php on line 186
 
 What about Backwards Compatibility? This doesn't look good for sure. Makes me
 think I should wrap the framework...

Zend_Loader's autoload solution has been basically broken from the
outset, and there's no way to fix it cleanly within that class.
Zend_Loader_Autoloader provides a much better solution that covers all
the use cases thrown at it so far: ability to toggle suppression of
errors, ability to register namespaces and do opportunistic mapping of
namespaces to autoloaders, ability to add instance methods as callbacks
to an autoloader -- and then remove and/or re-add them if desired
(something spl_autoload does not support cleanly), etc.

Note that we're marking Zend_Loader::autoload as _deprecated_ -- it's
not being removed, but we're giving fair warning that you may want to
update your code. This is a practice we've been using for some time to
mark deprecated code.


 Matthew Weier O'Phinney schreef:
 
 -- holografix . hologra...@gmail.com wrote
 (on Monday, 27 April 2009, 02:34 PM +0100):
 
 
 I have an application developed with ZF 1.7 and it works fine up to 
 ZF 1.7.8.
 After update developpment box to ZF to latest trunk version,
 starting to get notices about Zend_Loader::registerAutoload(), saying 
 it's
 deprecated and will be removed in 2.0.0.
 This application follows ZF directory structure and it registers a 
 front
 controller plugin where resources are initialized.
 
 New code in bootstrap.php:
 
 require_once 'Zend/Loader/Autoloader.php';
 
 $loader = 
 Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader(true);
 $loader-registerNamespace('ZendExt_');
 
 $front = Zend_Controller_Front::getInstance();
 $front-registerPlugin(new 
 ZendExt_Plugin_Initialize(APPLICATION_ENV));
 
 Resources are initialized but have some problems with loading a form.
 
 When opening the application, if one is not logged in, it redirects 
 to index/
 login (Form_Login.php)
 http://application = http://application/login
 
 Forms are in a dir called forms under application dir.
 In login action I have this code
 
 public function loginAction()
 {
 include APPLICATION_PATH . /forms/Form_Login.php;
 
 $loginForm = new Form_Login();
 
 ... validation and authentication
 }
 
 The output is wrong
 
 form action=/login method=post id=formlogin name=formlogin
 fieldset
 legendLogin/legend
 form id=username/form
 form id=password/form
 form id=submit/form
 /fieldset
 /form
 
 
 With Zend_Loader there are no problems.
 How can I fix the problem ?
 
 
 Use a module autoloader:
 
 $module = new Zend_Application_Module_Autoloader(array(
 'namespace' = '',
 'basePath'  = APPLICATION_PATH . '/forms',
 ));
 
 Then make sure your form is in the file:
 
 APPLICATION_PATH/
 forms/
 Login.php
 
 and contains the clas 'Form_Login'.
 
 You can do that anywhere -- your bootstrapping code is probably the best
 place, however. Once you have, you will not need to do an
 include/include_once to get your form -- just 'new Form_Login()'.
 
 
 

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread Matthew Weier O'Phinney
-- holografix . hologra...@gmail.com wrote
(on Monday, 27 April 2009, 04:18 PM +0100):
 problem
 I forgot to tell that this dev box is Win Vista 32
  
 In bootstrap.php:
  
 $module = new Zend_Application_Module_Autoloader(array(
'namespace' = '',
'basePath'  = APPLICATION_PATH . '/forms'
  ));
 Warning: include(C:\wwwroot\devapp\application/forms/forms//Login.php) [
 function.include]: failed to open stream: No such file or directory
  
 I change 'basePath' from APPLICATION_PATH . '/forms' to APPLICATION_PATH
 
 $module = new Zend_Application_Module_Autoloader(array(
'namespace' = '',
'basePath'  = APPLICATION_PATH
  ));
 Renamed APPLICATION_PATH\forms\Form_Login.php to Login.php and removed the
 include of this file in controller action.

My bad -- I jumped the gun. Yes, basePath = APPLICATION_PATH is what I
meant to write.

 The file is loaded but the output is the same:
 
 form action=/login
   method=post
   id=formlogin
   name=loginform
 
 fieldset
 legendLogin/legend
 
 form id=username/form
 form id=password/form
 form id=submit/form
 /fieldset
 /form

Can you provide the form class itself so I can take a look at it? Right
now, I have no idea what's wrong, nor how it could be generated.

Thanks!

 Cheers
 holo
 2009/4/27 Matthew Weier O'Phinney matt...@zend.com
 
 -- holografix . hologra...@gmail.com wrote
 (on Monday, 27 April 2009, 02:34 PM +0100):
  I have an application developed with ZF 1.7 and it works fine up to ZF
 1.7.8.
  After update developpment box to ZF to latest trunk version,
  starting to get notices about Zend_Loader::registerAutoload(), saying
 it's
  deprecated and will be removed in 2.0.0.
  This application follows ZF directory structure and it registers a front
  controller plugin where resources are initialized.
 
  New code in bootstrap.php:
 
  require_once 'Zend/Loader/Autoloader.php';
 
  $loader = Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader
 (true);
  $loader-registerNamespace('ZendExt_');
 
  $front = Zend_Controller_Front::getInstance();
  $front-registerPlugin(new ZendExt_Plugin_Initialize(APPLICATION_ENV));
 
  Resources are initialized but have some problems with loading a form.
 
  When opening the application, if one is not logged in, it redirects to
 index/
  login (Form_Login.php)
  http://application = http://application/login
 
  Forms are in a dir called forms under application dir.
  In login action I have this code
 
  public function loginAction()
  {
  include APPLICATION_PATH . /forms/Form_Login.php;
 
  $loginForm = new Form_Login();
 
  ... validation and authentication
  }
 
  The output is wrong
 
  form action=/login method=post id=formlogin name=formlogin
  fieldset
  legendLogin/legend
  form id=username/form
  form id=password/form
  form id=submit/form
  /fieldset
  /form
 
 
  With Zend_Loader there are no problems.
  How can I fix the problem ?
 
 Use a module autoloader:
 
$module = new Zend_Application_Module_Autoloader(array(
'namespace' = '',
'basePath'  = APPLICATION_PATH . '/forms',
));
 
 Then make sure your form is in the file:
 
APPLICATION_PATH/
forms/
Login.php
 
 and contains the clas 'Form_Login'.
 
 You can do that anywhere -- your bootstrapping code is probably the best
 place, however. Once you have, you will not need to do an
 include/include_once to get your form -- just 'new Form_Login()'.
 
 --
 Matthew Weier O'Phinney
 Project Lead| matt...@zend.com
 Zend Framework  | http://framework.zend.com/
 
 

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread holografix .
The form class in APPLICATION_PATH\forms\Login.php

class Form_Login extends Zend_Form
{
public function init() {
$this-setAction('/login')
 -setMethod('post')
 -setName('formlogin')
 -setAttrib('id', 'formlogin');

// Create and configure username element
$username = $this-createElement('text', 'username');
$username-setLabel('User')
 -addValidator('alnum')
 -addValidator('stringLength', false, array(3, 15))
 -setRequired(true)
 -setAttrib(size, 20)
 -setAttrib('maxLength', 20);

// Create and configure password element
$password = $this-createElement('password', 'password');
$password-setLabel('Password')
 -addValidator('StringLength', false, array(3, 15))
 -setAttrib(size, 20)
 -setAttrib('maxLength', 20)
 -setRequired(true);

// Create and configure submit button element
$submit = $this-createElement('submit', 'submit');
$submit-setRequired(false)
   -setIgnore(true)
   -setLabel('Login');

// Add elements to form
$this-addElement($username)
 -addElement($password)
 -addElement($submit);

return $this;
}
}

Thanks for the support
holo


2009/4/27 Matthew Weier O'Phinney matt...@zend.com

 -- holografix . hologra...@gmail.com wrote
 (on Monday, 27 April 2009, 04:18 PM +0100):
  problem
  I forgot to tell that this dev box is Win Vista 32
 
  In bootstrap.php:
 
  $module = new Zend_Application_Module_Autoloader(array(
 'namespace' = '',
 'basePath'  = APPLICATION_PATH . '/forms'
   ));
  Warning: include(C:\wwwroot\devapp\application/forms/forms//Login.php) [
  function.include]: failed to open stream: No such file or directory
 
  I change 'basePath' from APPLICATION_PATH . '/forms' to APPLICATION_PATH
 
  $module = new Zend_Application_Module_Autoloader(array(
 'namespace' = '',
 'basePath'  = APPLICATION_PATH
   ));
  Renamed APPLICATION_PATH\forms\Form_Login.php to Login.php and removed
 the
  include of this file in controller action.

 My bad -- I jumped the gun. Yes, basePath = APPLICATION_PATH is what I
 meant to write.

  The file is loaded but the output is the same:
 
  form action=/login
method=post
id=formlogin
name=loginform
 
  fieldset
  legendLogin/legend
 
  form id=username/form
  form id=password/form
  form id=submit/form
  /fieldset
  /form

 Can you provide the form class itself so I can take a look at it? Right
 now, I have no idea what's wrong, nor how it could be generated.

 Thanks!

  Cheers
  holo
  2009/4/27 Matthew Weier O'Phinney matt...@zend.com
 
  -- holografix . hologra...@gmail.com wrote
  (on Monday, 27 April 2009, 02:34 PM +0100):
   I have an application developed with ZF 1.7 and it works fine up to
 ZF
  1.7.8.
   After update developpment box to ZF to latest trunk version,
   starting to get notices about Zend_Loader::registerAutoload(),
 saying
  it's
   deprecated and will be removed in 2.0.0.
   This application follows ZF directory structure and it registers a
 front
   controller plugin where resources are initialized.
  
   New code in bootstrap.php:
  
   require_once 'Zend/Loader/Autoloader.php';
  
   $loader =
 Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader
  (true);
   $loader-registerNamespace('ZendExt_');
  
   $front = Zend_Controller_Front::getInstance();
   $front-registerPlugin(new
 ZendExt_Plugin_Initialize(APPLICATION_ENV));
  
   Resources are initialized but have some problems with loading a
 form.
  
   When opening the application, if one is not logged in, it redirects
 to
  index/
   login (Form_Login.php)
   http://application = http://application/login
  
   Forms are in a dir called forms under application dir.
   In login action I have this code
  
   public function loginAction()
   {
   include APPLICATION_PATH . /forms/Form_Login.php;
  
   $loginForm = new Form_Login();
  
   ... validation and authentication
   }
  
   The output is wrong
  
   form action=/login method=post id=formlogin
 name=formlogin
   fieldset
   legendLogin/legend
   form id=username/form
   form id=password/form
   form id=submit/form
   /fieldset
   /form
  
  
   With Zend_Loader there are no problems.
   How can I fix the problem ?
 
  Use a module autoloader:
 
 $module = new Zend_Application_Module_Autoloader(array(
 'namespace' = '',
 'basePath'  = APPLICATION_PATH . '/forms',
 ));
 
  Then make sure your form is in the file:
 
 

Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread Bart McLeod

For all of you who are also wondering what is needed to replace the good old

require_once 'Zend/Loader.php';
Zend_Loader::registerAutoLoad();

This is what is needed in it's most basic form:

require_once 'Zend/Loader/Autoloader.php';
$loader = 
Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader(true);


-Bart

holografix . schreef:

The form class in APPLICATION_PATH\forms\Login.php
 
class Form_Login extends Zend_Form

{
public function init() {
$this-setAction('/login')
 -setMethod('post')
 -setName('formlogin')
 -setAttrib('id', 'formlogin');
   
// Create and configure username element

$username = $this-createElement('text', 'username');
$username-setLabel('User')
 -addValidator('alnum')
 -addValidator('stringLength', false, array(3, 15))

 -setRequired(true)
 -setAttrib(size, 20)
 -setAttrib('maxLength', 20);   
   
// Create and configure password element

$password = $this-createElement('password', 'password');
$password-setLabel('Password')
 -addValidator('StringLength', false, array(3, 15))
 -setAttrib(size, 20)
 -setAttrib('maxLength', 20)
 -setRequired(true);   
   
// Create and configure submit button element

$submit = $this-createElement('submit', 'submit');
$submit-setRequired(false)
   -setIgnore(true)
   -setLabel('Login');
   
// Add elements to form

$this-addElement($username)
 -addElement($password)
 -addElement($submit);
   
return $this;

}
}

Thanks for the support
holo

 
2009/4/27 Matthew Weier O'Phinney matt...@zend.com 
mailto:matt...@zend.com


-- holografix . hologra...@gmail.com
mailto:hologra...@gmail.com wrote
(on Monday, 27 April 2009, 04:18 PM +0100):
 problem
 I forgot to tell that this dev box is Win Vista 32

 In bootstrap.php:

 $module = new Zend_Application_Module_Autoloader(array(
'namespace' = '',
'basePath'  = APPLICATION_PATH . '/forms'
  ));
 Warning:
include(C:\wwwroot\devapp\application/forms/forms//Login.php) [
 function.include]: failed to open stream: No such file or directory

 I change 'basePath' from APPLICATION_PATH . '/forms' to
APPLICATION_PATH

 $module = new Zend_Application_Module_Autoloader(array(
'namespace' = '',
'basePath'  = APPLICATION_PATH
  ));
 Renamed APPLICATION_PATH\forms\Form_Login.php to Login.php and
removed the
 include of this file in controller action.

My bad -- I jumped the gun. Yes, basePath = APPLICATION_PATH is
what I
meant to write.

 The file is loaded but the output is the same:

 form action=/login
   method=post
   id=formlogin
   name=loginform

 fieldset
 legendLogin/legend

 form id=username/form
 form id=password/form
 form id=submit/form
 /fieldset
 /form

Can you provide the form class itself so I can take a look at it?
Right
now, I have no idea what's wrong, nor how it could be generated.

Thanks!

 Cheers
 holo
 2009/4/27 Matthew Weier O'Phinney matt...@zend.com
mailto:matt...@zend.com

 -- holografix . hologra...@gmail.com
mailto:hologra...@gmail.com wrote
 (on Monday, 27 April 2009, 02:34 PM +0100):
  I have an application developed with ZF 1.7 and it works
fine up to ZF
 1.7.8.
  After update developpment box to ZF to latest trunk version,
  starting to get notices about
Zend_Loader::registerAutoload(), saying
 it's
  deprecated and will be removed in 2.0.0.
  This application follows ZF directory structure and it
registers a front
  controller plugin where resources are initialized.
 
  New code in bootstrap.php:
 
  require_once 'Zend/Loader/Autoloader.php';
 
  $loader =
Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader
 (true);
  $loader-registerNamespace('ZendExt_');
 
  $front = Zend_Controller_Front::getInstance();
  $front-registerPlugin(new
ZendExt_Plugin_Initialize(APPLICATION_ENV));
 
  Resources are initialized but have some problems with
loading a form.
 
  When opening the application, if one is not logged in, it
redirects to
 index/
  login (Form_Login.php)
  http://application http://application/ =
http://application/login
 
  Forms are in a dir called forms under application dir.
  In login action I have this code
 
  public 

Re: [fw-general] How to set up dependant dropdowns in form

2009-04-27 Thread 411161



Ace Paul wrote:
 
 I have a form, which I would like to use dependent drop downs in. I can't
 seem to find anything about it hear, after looking all morning trying to
 work it out.
 I have one field race_country
 when an option is selected I would like to show the cities in that
 country.
 The following is what I have currently in the form, which will show all
 countries and all cities.
 Any help would be great. thanks
 
 $table = new Country();
 foreach ($table-fetchAll() as $c) {
 $country-addMultiOption($c-country_id, $c-country_name);
 }
  $this-addElement( $country);
   
  $city = new Zend_Form_Element_Select('race_city');
 $city-setLabel('City')
  -setRequired(true);
  
 $table = new City();
 foreach ($table-fetchAll() as $c) {
 $city-addMultiOption($c-city_id, $c-city_name);
 }
  $this-addElement( $city);
 

Does anyone have a complete example of this?

I used this example to get it up and going:
http://techchorus.net/autocomplete-example-zenddojoformelementfilteringselect-and-zenddojodata

With the change located in the comments:
div dojoType=dojo.data.ItemFileReadStore url=/strain/list
jsId=strainStore/div

but I am having trouble trying to do dependent drop downs. Any good
references out there, or is this too early to attempt with Zend   Dojo?

-- 
View this message in context: 
http://www.nabble.com/How-to-set-up-dependant-dropdowns-in-form-tp20907379p23259776.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to set up dependant dropdowns in form

2009-04-27 Thread Bart McLeod
You should be using dojo selects in the first place, I have a working 
example (4files):

file index.phtml (in scripts/ directory)
?php echo $this-doctype() ?
html
head
   ?php echo $this-headTitle() ?
   ?php echo $this-headMeta() ?
   ?php echo $this-headLink() ?
   ?php echo $this-headStyle() ?
?php
  
   $this-dojo()-setLocalPath('/zf/js/dojo/dojo.js')

-addStyleSheetModule('dijit.themes.tundra');
   echo $this-dojo()-enable();
   echo $this-headScript();
?
  
/head

body class=tundra
   ?php echo $this-form ?
   ?php echo $this-inlineScript() ?
/body
/html

//following files in root directory
file index.php:

?php
require_once 'autoload.php';
$view = new Zend_View();
Zend_Dojo::enableView($view);

$form = new Zend_Dojo_Form('myform');
$form-setView($view);

$autoComplete1 = new Zend_Dojo_Form_Element_FilteringSelect('sel_1');
//$autoComplete1 = new Zend_Form_Element_Select('sel_1');
$autoComplete1-setMultiOptions(
   array('Cats', 'Dogs')
);
$autoComplete1-setAttrib('onchange', dijit.byId('sel_2').searchAttr = 
dijit.byId('sel_1').getValue();return true);

$autoComplete1-setLabel('Select 1');
$form-addElement($autoComplete1);
$searchAttribute = @$_GET['sel_1'];
if( ! in_array($searchAttribute, array('0', '1'))){
   $searchAttribute = '0';
}
$form-addElement(   
   'FilteringSelect',

   'sel_2',
array(
'label' = 'Select 2',
'storeId' = 'myData',
'storeType'= 'dojo.data.ItemFileReadStore',
'storeParams' = array( 'url' = '/zf/dojo.php',),
'dijitParams' = array( 'searchAttr' = $searchAttribute, ),
)
);
$form-addElement('submit','go');
$form-populate($_GET);
$view-form = $form-render();
$view-addBasePath('E:\werk\zf fixes\testsite');
echo $view-render('index.phtml');

?

file dojo.php:
?php
   require_once 'autoload.php';
  
   $data = new Zend_Dojo_Data();

   $data-setIdentifier('name');
  
   $cats = array('Lion', 'Cheeta', 'Cat');
  
   foreach ($cats as $key = $cat) {

   $data-addItem(array('name' = $key, '0' = $cat));
   }

   $dogs = array(3 = 'Bello', 4 = 'Blix', 5 = 'Freddy', 6 = 'Hungry 
Bill');

   foreach ($dogs as $key = $dog) {
   $data-addItem(array('name' = $key,1 = $dog));
   }
  
   echo $data;   


file autoload.php: (depecated)
?php

require_once 'Zend/Loader.php';
/**
* Loads all Zend Framework classes automagically
*
* @param string $className
*/
function __autoload($className){
   Zend_Loader::loadClass($className);
}

?

Hope this helps,

Bart

411161 schreef:


Ace Paul wrote:
  

I have a form, which I would like to use dependent drop downs in. I can't
seem to find anything about it hear, after looking all morning trying to
work it out.
I have one field race_country
when an option is selected I would like to show the cities in that
country.
The following is what I have currently in the form, which will show all
countries and all cities.
Any help would be great. thanks

$table = new Country();
foreach ($table-fetchAll() as $c) {
$country-addMultiOption($c-country_id, $c-country_name);
}
 $this-addElement( $country);
  
 $city = new Zend_Form_Element_Select('race_city');

$city-setLabel('City')
 -setRequired(true);
 
$table = new City();

foreach ($table-fetchAll() as $c) {
$city-addMultiOption($c-city_id, $c-city_name);
}
 $this-addElement( $city);




Does anyone have a complete example of this?

I used this example to get it up and going:
http://techchorus.net/autocomplete-example-zenddojoformelementfilteringselect-and-zenddojodata

With the change located in the comments:
div dojoType=dojo.data.ItemFileReadStore url=/strain/list
jsId=strainStore/div

but I am having trouble trying to do dependent drop downs. Any good
references out there, or is this too early to attempt with Zend   Dojo?

  


[fw-general] Mass setting of Decorator_Label options

2009-04-27 Thread Aicos

Hi

I have a Zend_Form I just wonder if there is a quick way of setting up the
default Label decorator so that if displays the Required (*) option for
elements that have been set setRequired(true).  Do I need to create a new
instance of Zend_Form_Decorator_Label with the Required(*) option set for
EVERY element separately?

Thanks in advance

-- 
View this message in context: 
http://www.nabble.com/Mass-setting-of-Decorator_Label-options-tp23260040p23260040.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Tool: zf create action doesn't work

2009-04-27 Thread Ralph Schindler

Can you try r15204 from trunk?  I think all these problems are solved now :)

-ralph

Mario Guenterberg wrote:

On So, Apr 26, 2009 at 08:54:26 +0100, Rob Allen wrote:

Hi,

Using svn trunk (revision 15159) Anyone else seeing this problem with zf 
create action:



$ zf create project zftest
Creating project at /www/tmp/zftest

$ cd zftest/
$ zf create action test

Fatal error: Class 'Zend_Controller_Action' not found in /www/tmp/ 
zftest/application/controllers/IndexController.php on line 3


Hi Rob,

I got the same error with Rev. 15149 from yesterday.

Greetings Mario



Re: [fw-general] Zend_Tool: zf create action doesn't work

2009-04-27 Thread Ralph Schindler

Hey Rob,

can you try r15204 in trunk?

-ralph

Rob Allen wrote:


On 26 Apr 2009, at 16:44, Matthew Weier O'Phinney wrote:


Basically, with the advent of Zend_Application, we don't need to use
require_once statement within our controllers (since autoloading is on
by default). The trick, then, is getting autoloading setup correctly per
your application when doing class reflection -- which is what Ralph is
working on.


That make sense. I wondered if it was related to the zf create project 
problem, but then wasn't sure as that got fixed :)


Regards,

Rob...



Re: [fw-general] Zend_Tool: zf create action doesn't work

2009-04-27 Thread Mario Guenterberg
On Mo, Apr 27, 2009 at 11:47:05 -0500, Ralph Schindler wrote:
 Can you try r15204 from trunk?  I think all these problems are solved now :)

 -ralph


Done! And it works fine ... :-)

Thanks...

Mario

-- 
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS/CM d- s++: a+ C$ UBL*$ P++ L+++ E--- W+++ N+ o-- K- w O- M-
V-- PS++ PE++ Y PGP+++ t--- 5 X R++ tv- b+++ DI D  G++ e* h
r+++ y
--END GEEK CODE BLOCK--


Re: [fw-general] RFC: Zend_Dojo_Data associative arrays

2009-04-27 Thread Giorgio Sironi
2009/4/27 lightflowmark 1...@lightflowinterrupted.com

 I really don't see this as being a big enough enhancement to merit a
 proposal; hopefully this code will prove useful in the next iteration of
 Zend_Dojo_Data (and the hoped-for dijit.Tree view helper ;-))


I see the need for matching the gap between php and javascript, but adding
some testcases should be a primary objective.


-- 
Giorgio Sironi
Piccolo Principe  Ossigeno Scripter
http://ossigeno.sourceforge.net


Re: [fw-general] Mass setting of Decorator_Label options

2009-04-27 Thread Giorgio Sironi
2009/4/27 Aicos nige...@fastmail.net

 I have a Zend_Form I just wonder if there is a quick way of setting up the
 default Label decorator so that if displays the Required (*) option for
 elements that have been set setRequired(true).  Do I need to create a new
 instance of Zend_Form_Decorator_Label with the Required(*) option set for
 EVERY element separately?


Personally I have all my forms extends a base Otk_Form class (subclass of
Zend_Dojo_Form or Zend_Form as you need) where put all hooks and common
configuration for the application. For example you can override addElement()
or similar to set the right decorators for element.

-- 
Giorgio Sironi
Piccolo Principe  Ossigeno Scripter
http://ossigeno.sourceforge.net


Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread Matthew Weier O'Phinney
-- Bart McLeod mcl...@spaceweb.nl wrote
(on Monday, 27 April 2009, 06:11 PM +0200):
 For all of you who are also wondering what is needed to replace the good old
 
 require_once 'Zend/Loader.php';
 Zend_Loader::registerAutoLoad();
 
 This is what is needed in it's most basic form:
 
 require_once 'Zend/Loader/Autoloader.php';
 $loader = Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader(true);


In most cases, you won't even need to call setFallbackAutoloader(), btw.


 holografix . schreef:
 
 The form class in APPLICATION_PATH\forms\Login.php
  
 class Form_Login extends Zend_Form
 {
 public function init() {
 $this-setAction('/login')
  -setMethod('post')
  -setName('formlogin')
  -setAttrib('id', 'formlogin');

 // Create and configure username element
 $username = $this-createElement('text', 'username');
 $username-setLabel('User')
  -addValidator('alnum')
  -addValidator('stringLength', false, array(3, 15))
  -setRequired(true)
  -setAttrib(size, 20)
  -setAttrib('maxLength', 20);   

 // Create and configure password element
 $password = $this-createElement('password', 'password');
 $password-setLabel('Password')
  -addValidator('StringLength', false, array(3, 15))
  -setAttrib(size, 20)
  -setAttrib('maxLength', 20)
  -setRequired(true);   

 // Create and configure submit button element
 $submit = $this-createElement('submit', 'submit');
 $submit-setRequired(false)
-setIgnore(true)
-setLabel('Login');

 // Add elements to form
 $this-addElement($username)
  -addElement($password)
  -addElement($submit);

 return $this;
 }
 }
 
 Thanks for the support
 holo
 
  
 2009/4/27 Matthew Weier O'Phinney matt...@zend.com
 
 -- holografix . hologra...@gmail.com wrote
 (on Monday, 27 April 2009, 04:18 PM +0100):
  problem
  I forgot to tell that this dev box is Win Vista 32
 
  In bootstrap.php:
 
  $module = new Zend_Application_Module_Autoloader(array(
 'namespace' = '',
 'basePath'  = APPLICATION_PATH . '/forms'
   ));
  Warning: include(C:\wwwroot\devapp\application/forms/forms//
 Login.php) [
  function.include]: failed to open stream: No such file or directory
 
  I change 'basePath' from APPLICATION_PATH . '/forms' to
 APPLICATION_PATH
 
  $module = new Zend_Application_Module_Autoloader(array(
 'namespace' = '',
 'basePath'  = APPLICATION_PATH
   ));
  Renamed APPLICATION_PATH\forms\Form_Login.php to Login.php and
 removed the
  include of this file in controller action.
 
 My bad -- I jumped the gun. Yes, basePath = APPLICATION_PATH is what 
 I
 meant to write.
 
  The file is loaded but the output is the same:
 
  form action=/login
method=post
id=formlogin
name=loginform
 
  fieldset
  legendLogin/legend
 
  form id=username/form
  form id=password/form
  form id=submit/form
  /fieldset
  /form
 
 Can you provide the form class itself so I can take a look at it? 
 Right
 now, I have no idea what's wrong, nor how it could be generated.
 
 Thanks!
 
  Cheers
  holo
  2009/4/27 Matthew Weier O'Phinney matt...@zend.com
 
  -- holografix . hologra...@gmail.com wrote
  (on Monday, 27 April 2009, 02:34 PM +0100):
   I have an application developed with ZF 1.7 and it works fine
 up to ZF
  1.7.8.
   After update developpment box to ZF to latest trunk version,
   starting to get notices about Zend_Loader::registerAutoload(),
 saying
  it's
   deprecated and will be removed in 2.0.0.
   This application follows ZF directory structure and it
 registers a front
   controller plugin where resources are initialized.
  
   New code in bootstrap.php:
  
   require_once 'Zend/Loader/Autoloader.php';
  
   $loader = Zend_Loader_Autoloader::getInstance()-
 setFallbackAutoloader
  (true);
   

Re: [fw-general] ZendX_JQuery not loaded using Zend_Application

2009-04-27 Thread Bart McLeod
I think you should call enable() on your jQuery() view helper. This is 
what is done automatically if you use the ajaxLink, hence the different 
behavior.


-Bart

Bagus Nugroho schreef:

Hi,
I have put ?= $this-jQuery() ? in the head, but JQuery still not 
loaded on browser.

Is anyone have same problem?
 
Thanks,

Regards, bn


*From:* Jay M. Keith [mailto:googla...@gmail.com]
*Sent:* Fri 17-Apr-2009 11:12
*To:* Bagus Nugroho
*Cc:* fw-general
*Subject:* Re: [fw-general] ZendX_JQuery not loaded using Zend_Application

In your layout (if you're using layouts), do you have something like
?= $this-jQuery() ? in the head?

Regards,
Jay M. Keith

On Thu, Apr 16, 2009 at 8:36 PM, Bagus Nugroho 
bnugr...@unisemgroup.com wrote:

 Hi All,
 I'm trying using ZendX_JQuery within Zend_Application, which 
generated by
 Zend_Tool and edited Bootstrap.php, refer 'storefront' to add 
ZendX_JQuery

 as the following :
 Bootstrap.php===
 //
 protected function _initView()
 {
 $viewRenderer =
 Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
 $viewRenderer-init();

 $this-_view = $viewRenderer-view;
 $this-_view-setEncoding('UTF-8');
 $this-_view-doctype('XHTML1_STRICT');
 $this-_view-headTitle('Development');

 //Load themes

 $this-_view-headLink()-appendStylesheet('/themes/base/ui.all.css');

 // Add jQuery

 
$this-_view-addHelperPath('ZendX/JQuery/View/Helper','ZendX_JQuery_View_Helper');


 $this-_view-jQuery()-setLocalPath('../scripts/jquery-1.3.2.min.js');

 
$this-_view-jQuery()-setUiLocalPath('../scripts/jquery.ui/jquery-ui.min.js');


 Zend_Layout::startMvc(array('layout' = 'main',
 'layoutPath' = APPLICATION_PATH . '/layouts/scripts'
 ));
 }
 //
 

 why jquery library not loaded when I'm load the page.

 But jquery library loaded, when I add the following code on
 scripts(index.phtml)
 index.phtml==
 ?= $this-ajaxLink(Show me something,
 /index/demo,
 array('update' = '#content')); ?
 div id=content/div
 

 Is I'm missing something?

 Thanks in advance, bn









Re: [fw-general] Replacing Zend_Loader by Zend_Loader_Autoloader

2009-04-27 Thread Matthew Weier O'Phinney
-- Bart McLeod mcl...@spaceweb.nl wrote
(on Monday, 27 April 2009, 08:37 PM +0200):
 
 
 Matthew Weier O'Phinney schreef:
 
 -- Bart McLeod mcl...@spaceweb.nl wrote
 (on Monday, 27 April 2009, 06:11 PM +0200):
 
 
 For all of you who are also wondering what is needed to replace the 
 good old
 
 require_once 'Zend/Loader.php';
 Zend_Loader::registerAutoLoad();
 
 This is what is needed in it's most basic form:
 
 require_once 'Zend/Loader/Autoloader.php';
 $loader = 
 Zend_Loader_Autoloader::getInstance()-setFallbackAutoloader(true);
 
 
 
 In most cases, you won't even need to call setFallbackAutoloader(), btw.
 
 
 I tried immediately, but in my case I need it. What does it do actually? Will
 look that up in the manual.

By default, Zend_Loader_Autoloader acts as a namespace autoloader, and
only registers the Zend_ and ZendX_ namespace prefixes. That means that
if the class doesn't match these prefixes, the autoloader passes over
the class and moves on to the next autoloader registered, if any.

You can have it try to match _any_ namespace by setting it as the
fallback autoloader.

If you were using autoloading to load resources in your application
tree, the preferred approach is to use either
Zend_Loader_Autoloader_Resource or Zend_Application_Module_Autoloader
(which derives from the former); these will then perform autoloading for
those resources, typically in a separate namespace.


 holografix . schreef:
 
 The form class in APPLICATION_PATH\forms\Login.php
 
 class Form_Login extends Zend_Form
 {
 public function init() {
 $this-setAction('/login')
  -setMethod('post')
  -setName('formlogin')
  -setAttrib('id', 'formlogin');
 
 // Create and configure username element
 $username = $this-createElement('text', 'username');
 $username-setLabel('User')
  -addValidator('alnum')
  -addValidator('stringLength', false, array(3, 
 15))
  -setRequired(true)
  -setAttrib(size, 20)
  -setAttrib('maxLength', 20);
 
 // Create and configure password element
 $password = $this-createElement('password', 'password');
 $password-setLabel('Password')
  -addValidator('StringLength', false, array(3, 
 15))
  -setAttrib(size, 20)
  -setAttrib('maxLength', 20)
  -setRequired(true);
 
 // Create and configure submit button element
 $submit = $this-createElement('submit', 'submit');
 $submit-setRequired(false)
-setIgnore(true)
-setLabel('Login');
 
 // Add elements to form
 $this-addElement($username)
  -addElement($password)
  -addElement($submit);
 
 return $this;
 }
 }
 
 Thanks for the support
 holo
 
 
 2009/4/27 Matthew Weier O'Phinney matt...@zend.com
 
 -- holografix . hologra...@gmail.com wrote
 (on Monday, 27 April 2009, 04:18 PM +0100):
  problem
  I forgot to tell that this dev box is Win Vista 32
 
  In bootstrap.php:
 
  $module = new Zend_Application_Module_Autoloader(array(
 'namespace' = '',
 'basePath'  = APPLICATION_PATH . '/forms'
   ));
  Warning: include(C:\wwwroot\devapp\application/forms/forms//
 Login.php) [
  function.include]: failed to open stream: No such file or 
 directory
 
  I change 'basePath' from APPLICATION_PATH . '/forms' to
 APPLICATION_PATH
 
  $module = new Zend_Application_Module_Autoloader(array(
 'namespace' = '',
 'basePath'  = APPLICATION_PATH
   ));
  Renamed APPLICATION_PATH\forms\Form_Login.php to Login.php 
 and
 removed the
  include of this file in controller action.
 
 My bad -- I jumped the gun. Yes, basePath = APPLICATION_PATH 
 is what I
 meant to write.
 
  The file is loaded but the output is the same:
 
  form action=/login
method=post
id=formlogin

Re: [fw-general] Serializing select objects supposed to be working but isn't.

2009-04-27 Thread Themselves



Themselves wrote:
 
 Hi guys, I've come up with a situation in my application where serializing
 a
 select object to store it in a session variable would be remarkably
 useful,
 but it isn't working. It's just throwing the usual can't serialize a PDO
 object error. This was apparently fixed in
 http://framework.zend.com/issues/browse/ZF-4600. Here's my basic code.
 
 class DbTable_Candidates extends Zend_Db_Table_Abstract
 {
 /**
  * @var string Table name
  */
 public $_name = 'candidates';
 
 /**
  * @var string Primary key
  */
 public $_primary = 'id';
 }
 
 ...then, later on...
 
 function fetchList($criteria) {
$table = new DbTable_Candidates();
$adapter = $table-getAdapter();
$select  = $adapter-select();
 
 ... a bunch of stuff gets added to the $select object
 
$serialize = serialize($select);
 }
 
 and the error: You cannot serialize or unserialize PDO instances
 
 This is on 1.7.8 of the framework, by the way.
 
 

Oh. Ok, so this functionality works just fine, I just didn't read the URL I
linked correctly, the functionality to serialize Zend_Db_Select objects
isn't added until the 1.8 release, so if you're trying to get it working
with an earlier version, upgrade. 
-- 
View this message in context: 
http://www.nabble.com/Serializing-select-objects-supposed-to-be-working-but-isn%27t.-tp23212103p23269501.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Session::regenerateId timing issue in Safari and IE

2009-04-27 Thread swilhelm

It appears I have the same
http://www.nabble.com/concerned-about-regenerating-id-td13896143.html#a13896143 
issue reported back in Nov 2007 by Ergo. 

I want to regenerate the session id on every request as recommended in the
documentation, but there seems to be a timing problem on Safari and IE. If
users make several requests very quickly, the session is lost.

Ergo suggests a work around, namely calling PHP's session_regenerate_id()
directly without the true argument. This seems to work for me, but it
appears Zend_Session::regenerateId() stores some internal state that will
not be set using this approach.

My questions is, should I call session_regenerate_id() directly or is there
some other recommended solution?

- Steve W.
-- 
View this message in context: 
http://www.nabble.com/Zend_Session%3A%3AregenerateId-timing-issue-in-Safari-and-IE-tp23270303p23270303.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend Framework 1.8.0 sanity check tarballs available

2009-04-27 Thread Matthew Weier O'Phinney
We have posted sanity check tarballs of the upcoming 1.8.0 release on
the site. You may get them at the following URLs:

http://framework.zend.com/releases/preview/ZendFramework-1.8.0.tar.gz
http://framework.zend.com/releases/preview/ZendFramework-1.8.0.zip

http://framework.zend.com/releases/preview/ZendFramework-1.8.0-minimal.tar.gz
http://framework.zend.com/releases/preview/ZendFramework-1.8.0-minimal.zip
http://framework.zend.com/releases/preview/ZendAMF-1.8.0.tar.gz
http://framework.zend.com/releases/preview/ZendAMF-1.8.0.zip
http://framework.zend.com/releases/preview/ZendGdata-1.8.0.tar.gz
http://framework.zend.com/releases/preview/ZendGdata-1.8.0.zip
http://framework.zend.com/releases/preview/ZendInfoCard-1.8.0.tar.gz
http://framework.zend.com/releases/preview/ZendInfoCard-1.8.0.zip

Please let the Zend Framework team know ASAP if you notice any critical
errors. We will be releasing within the next few days.

For those who have contributed to this release, thanks again for all the
hard work -- the end is in sight!

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/