[fw-general] Re: Zendx Jquery Datepicker custom viewscript

2008-11-28 Thread Colin Guthrie

Benjamin Eberlei wrote:
when you want to seperate design and programming with zend form you can remove 
all markup decorators from the elements and just place them with 
element1; ?> i think (or was it getElement('element1'); ?>).


designers can then build the markup while the programmers just build forms 
that dont have markup decorators (like htmltag, label, dd/dt).


Of course the downside with that approach is that if you add a new 
element to your form, you have to inform the design team and ensure they 
add that element in.


IMO it's probably better to establish a solid structural decoration plan 
of your forms and try not to vary that. The developers work with it from 
a structural perspective and the designers work with it from a 
CSS/styling perspective.


If you have to change it, then do the whole "let's actually talk/share 
information" thing between the two teams.


I think that is a more efficient approach than the more verbose way of 
essentially replicating knowledge of what the form contains on both 
logic and view sides of the fence.


COL


--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]



[fw-general] [Zend_Form] Associated Yes/No Radios and Details Textarea

2008-11-28 Thread Steve Reed

http://www.nabble.com/file/p20732321/form-element.png 

This is what I would like to achieve with Zend_Form and was looking for some
suggestions on how best to implement it.

Ideally it would be marked up like this:


Did you find our site easy to use?


Yes
No
If no, please provide details:


Please provide details



I can do this with a sub form and view script decorator but wondered if
there might be better approaches? Using display group functionality for
example?
-- 
View this message in context: 
http://www.nabble.com/-Zend_Form--Associated-Yes-No-Radios-and-Details-Textarea-tp20732321p20732321.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] How to store attachment files into a location in server

2008-11-28 Thread Anees

Hi

i am developing a module that sores all emails coming to an account into a
database
and i have succeeded in that using Zend_Mail_Storage_Pop3 calss

and also i am getting the information about the attachments that sending
with mail
i can display it, download it.. (using header() function )

But i need to store the file into a location in server
how i can do this?

please help

Regards,
Anees

-- 
View this message in context: 
http://www.nabble.com/How-to-store-attachment-files-into-a-location-in-server-tp20732847p20732847.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] QUestion about jQuery ajaxLink

2008-11-28 Thread vladimirn

Hello all,
I have one simply question.
Whats the use of ajaxLInk? So far i find out that one can use ajaxLink only
like a some kind of toy, which could achieved by using any ajax script to
get some content into desired container.
It is pretty much hard for me to explain, so i will trow an example.

You have an link in your navigation. Eg. Home
This link looks like:
ajaxLink(
"Home", "/admin/index/home",
array( 'id' => 'edit',
  'update' => '#content',
'noscript' => false,
'inline' => true,
'dataType'=>'script',
'method' => 'POST')); 
?>
What happens here? We will get things from homeAction within
indexController.php, right?
And thats all?

I am asking this because i want to have another ajaxLink inside #contetn
container. And it seems immpossible to get it work. I tried dataType=html as
well, and nothing happens. 
Does it mean that ajaxLink can be used ONLY outside #container?
I am not familiar with writing any ajax or javascript functions so i am
pretty much stucked on this.
Also i think that great developers from ZF are able to make this work.
Otherwise i dont see some real use of ajaxLink plugin.
I really like idea of having ajaxLink avaliable inside ajaxLink requested
content.
Can anyone help me on this?
-- 
View this message in context: 
http://www.nabble.com/QUestion-about-jQuery-ajaxLink-tp20732925p20732925.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Translate'd Zend_Validate messages for each language

2008-11-28 Thread Iwasaki Teruyuki
Hi all,

I have started using Zend_Form / Zend_Validate with Zend_Translate.
I notices that you need to redefine a lot of validation error messages
in your language.

It would be very helpful if there are default translation in many languages.
Can you find it anywhere?

If not, maybe I can prepare Japanese translation so Japanese people
can use it in the future if they can find it.
Any good place for that? (if no, i will just paste it on my own blog)

Thanks,

-- 
:: Iwasaki Teruyuki | atamasoft
:: twitter: twk | skype: iwasakiteruyuki


[fw-general] Zend_Translate'd Zend_Validate messages for each language

2008-11-28 Thread 岩崎輝之
Hi all,

I have started using Zend_Form / Zend_Validate with Zend_Translate.
I notices that you need to redefine a lot of validation error messages
in your language.

It would be very helpful if there are default translation in many languages.
Can you find it anywhere?

If not, maybe I can prepare Japanese translation so Japanese people
can use it in the future if they can find it.
Any good place for that? (if no, i will just paste it on my own blog)

Thanks,

--
:: Iwasaki Teruyuki | atamasoft
:: twitter: twk | skype: iwasakiteruyuki


Re: [fw-general] Zend_Config_ini keys

2008-11-28 Thread Martijn Korse


Cristian Bichis-3 wrote:
> 
> Hello,
> 
> I have one question while working with a Zend_Config_Ini.
> 
> I need to assign values like that:
> 
> elements.ENCODING.options.multiOptions.UTF-8 = "UTF-8"
> 
> is this correct ?

I think it is. As far as i know the illegal characters are: { } | & ~ ! [ (
) " , none of which occur in your key


How about this ?
> 
> elements.ENCODING.options.multiOptions.Windows_1251 (CP1251) = 
> "Windows_1251 (CP1251)"

This one contains illegal characters in the key (see above)


How i can specify those keys to be correct ?

You could define it like this:
elements.ENCODING.options.multiOptions.0.key = "Windows_1251 (CP1251)"
elements.ENCODING.options.multiOptions.0.value = "Windows_1251 (CP1251)"
elements.ENCODING.options.multiOptions.1.key = "UTF-8"
elements.ENCODING.options.multiOptions.1.value = "UTF-8"

Although in your specific case it has little sense as the key seems to match
the value always. But this is how you could solve it when the key and the
value are different.

-- 
Best regards,
Cristian Bichis
www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com





-
http://devshed.excudo.net http://devshed.excudo.net 
-- 
View this message in context: 
http://www.nabble.com/Zend_Config_ini-keys-tp20726180p20734891.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to store attachment files into a location in server

2008-11-28 Thread Martijn Korse


Anees wrote:
> 
> [...]
> But i need to store the file into a location in server
> how i can do this?
> 

with 'the file' you mean the attachment?

What is your problem exactly? Don't you know the php-command for opening and
writing to a file? Are you concerned about security? etc.

-
http://devshed.excudo.net http://devshed.excudo.net 
-- 
View this message in context: 
http://www.nabble.com/How-to-store-attachment-files-into-a-location-in-server-tp20732847p20734981.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Best practice for forms, models, validators and filters?

2008-11-28 Thread Ralf Eggert
Hi,

I am currently thinking about the best practice for handling forms,
models, validators and filters with the Zend Framework.

Think of a user model with username, emailaddress and a password fields.
The model uses a Zend_Db_Table object for data storage. The username
field should only contain alphanumeric values with a length between 4
and 32 signs, the emailaddress field should only contain valid email
addresses and the password must have a minimum length of 10 signs and
should contain at least one char and one number. All fields should be
filtered with a trim and as striptags filter.

This model needs forms for registration, login and update. The
registration form contains all three fields as required fields, the
login form only contains username and password both as required fields
and the update form contains all fields, but the password field is not
required.

Where and how would you define the validator and filter rules?

a) Within the model. If yes, how can the form access these rules?
b) Within the form. If yes, how can the model access these rules
   and does the model really need to access these rules?
c) In both the model and form. Not a good idea to duplicate the
   definitions, I think.
d) Outside of the model and form in definition files (INI, XML). Both
   the model and the form can read these files via Zend_Config
   whenever they need them.
e) Create an object that contains the rule definitions. Both the model
   and form can access this object to get the validation and filter
   rules when needed.
f) maybe your idea...

What do you think?

Thanks and best regards,

Ralf


Re: [fw-general] How to store attachment files into a location in server

2008-11-28 Thread Bruno Friedmann
Anees wrote:
> Hi
> 
> i am developing a module that sores all emails coming to an account into a
> database
> and i have succeeded in that using Zend_Mail_Storage_Pop3 calss
> 
> and also i am getting the information about the attachments that sending
> with mail
> i can display it, download it.. (using header() function )
> 
> But i need to store the file into a location in server
> how i can do this?
> 
> please help
> 
> Regards,
> Anees
> 

If you store email in db why not the attachement in a (blob clob) binary 
columns.
So you never get worried about what attachment get with which mail.

Ok you need a good db for sure. But atferward they are made for this.



-- 

 Bruno Friedmann


Re: [fw-general] Best practice for forms, models, validators and filters?

2008-11-28 Thread Matthew Weier O'Phinney
-- Ralf Eggert <[EMAIL PROTECTED]> wrote
(on Friday, 28 November 2008, 04:43 PM +0100):
> I am currently thinking about the best practice for handling forms,
> models, validators and filters with the Zend Framework.
> 
> Think of a user model with username, emailaddress and a password fields.
> The model uses a Zend_Db_Table object for data storage. The username
> field should only contain alphanumeric values with a length between 4
> and 32 signs, the emailaddress field should only contain valid email
> addresses and the password must have a minimum length of 10 signs and
> should contain at least one char and one number. All fields should be
> filtered with a trim and as striptags filter.
> 
> This model needs forms for registration, login and update. The
> registration form contains all three fields as required fields, the
> login form only contains username and password both as required fields
> and the update form contains all fields, but the password field is not
> required.
> 
> Where and how would you define the validator and filter rules?
> 
> a) Within the model. If yes, how can the form access these rules?
> b) Within the form. If yes, how can the model access these rules
>and does the model really need to access these rules?
> c) In both the model and form. Not a good idea to duplicate the
>definitions, I think.
> d) Outside of the model and form in definition files (INI, XML). Both
>the model and the form can read these files via Zend_Config
>whenever they need them.
> e) Create an object that contains the rule definitions. Both the model
>and form can access this object to get the validation and filter
>rules when needed.
> f) maybe your idea...

What I've started doing and recommending is to attach forms to your
model, and to use forms for model validation. 

As an example, an "add()" method in your model might have the following:

public function add(array $data)
{
$form = $this->getForm();

if (!$form->isValid($data)) {
return false;
}

if (!$id = $this->getTable()->insert($form->getValues())) {
throw new Exception('Unable to insert record');
}

return $id;
}

This is particularly feasible since 1.6.0, when all plugins were
modified to allow lazy-loading -- if you don't render a form, the actual
decorator objects will not be instantiated, and if you're rendering a
form for the first time, validators will not be loaded.

Another benefit is that your models now also have a concrete
representation as a form. Basically, the technique prevents code
duplication, and relates forms and models semantically.

(For a practical example, you can look at the pastebin demo app at
http://github.com/weierophinney/pastebin -- look under
application/models/).

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] Best practice for forms, models, validators and filters?

2008-11-28 Thread Ralf Eggert
Hi Matthew,

> What I've started doing and recommending is to attach forms to your
> model, and to use forms for model validation. 

Thanks for your reply. Your approach sounds very sensible to me. But I
am not sure how you handle different forms for the same model. In my
example I have different forms which use the same validator and filter
definitions for the same fields.

Would you define the validators and filters for the username field in
all three forms? If you want to change these rules for the username
field you need to change these definitions in each form, don't you?

And how do you handle different forms for the same model, say the create
form is different than the update form?

Thanks and best regards,

Ralf


Re: [fw-general] Best practice for forms, models, validators and filters?

2008-11-28 Thread Matthew Weier O'Phinney
-- Ralf Eggert <[EMAIL PROTECTED]> wrote
(on Friday, 28 November 2008, 06:23 PM +0100):
> > What I've started doing and recommending is to attach forms to your
> > model, and to use forms for model validation. 
> 
> Thanks for your reply. Your approach sounds very sensible to me. But I
> am not sure how you handle different forms for the same model. In my
> example I have different forms which use the same validator and filter
> definitions for the same fields.
> 
> Would you define the validators and filters for the username field in
> all three forms? If you want to change these rules for the username
> field you need to change these definitions in each form, don't you?

I typically define forms explicitly as discrete classes -- and the same
for elements. What I would suggest is that if there are common elements
you use across multiple forms that will be using the same
validators/filters/decorators/etc... then create a custom element:

class My_Form_Element_Username
{
public function init()
{
$this->addValidators(array(
'Alnum',
array('StringLength', false, array(6, 20)),
));
$this->setRequired(true);
}
}

In your form classes, use these custom elements. That way, if you change
the rules for a single element type, it will propogate to all forms that
use it.

> And how do you handle different forms for the same model, say the create
> form is different than the update form?

A single model can certainly have multiple forms -- the example I
displayed was just a simple one.

Have a getter for each form, or have getForm() accept an argument
indicating the form to retrieve.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] Best practice for forms, models, validators and filters?

2008-11-28 Thread Ionut Gabriel Stan

Matthew Weier O'Phinney wrote:

-- Ralf Eggert<[EMAIL PROTECTED]>  wrote
(on Friday, 28 November 2008, 06:23 PM +0100):
   

What I've started doing and recommending is to attach forms to your
model, and to use forms for model validation.
   

Thanks for your reply. Your approach sounds very sensible to me. But I
am not sure how you handle different forms for the same model. In my
example I have different forms which use the same validator and filter
definitions for the same fields.

Would you define the validators and filters for the username field in
all three forms? If you want to change these rules for the username
field you need to change these definitions in each form, don't you?
 


I typically define forms explicitly as discrete classes -- and the same
for elements. What I would suggest is that if there are common elements
you use across multiple forms that will be using the same
validators/filters/decorators/etc... then create a custom element:

 class My_Form_Element_Username
 {
 public function init()
 {
 $this->addValidators(array(
 'Alnum',
 array('StringLength', false, array(6, 20)),
 ));
 $this->setRequired(true);
 }
 }

In your form classes, use these custom elements. That way, if you change
the rules for a single element type, it will propogate to all forms that
use it.

   

And how do you handle different forms for the same model, say the create
form is different than the update form?
 


A single model can certainly have multiple forms -- the example I
displayed was just a simple one.

Have a getter for each form, or have getForm() accept an argument
indicating the form to retrieve.

   
Wouldn't be better a reversed relationship, i.e. a series of forms have 
a setter setModel() and the whole validation

logic is inside the model (the place that I think is the most appropriate) ?

Ralf said "And how do you handle different forms for the same model, say 
the create


form is different than the update form?"


IMHO this is a case where validation should stay in the model and the 
form would have access to the validators
in the model. Also, there is no need to duplicate a setForm() method or 
add parameters to it.
I came to this conclusion after I realized that Zend_Form is just a very 
specialized controller + view. The only thing

missing is the model.



Re: [fw-general] Best practice for forms, models, validators and filters?

2008-11-28 Thread Matthew Weier O'Phinney
-- Ionut Gabriel Stan <[EMAIL PROTECTED]> wrote
(on Friday, 28 November 2008, 08:17 PM +0200):
> Matthew Weier O'Phinney wrote:
> > -- Ralf Eggert<[EMAIL PROTECTED]>  wrote
> > (on Friday, 28 November 2008, 06:23 PM +0100):
> > > > What I've started doing and recommending is to attach forms to your
> > > > model, and to use forms for model validation.
> > > >
> > > Thanks for your reply. Your approach sounds very sensible to me. But I
> > > am not sure how you handle different forms for the same model. In my
> > > example I have different forms which use the same validator and filter
> > > definitions for the same fields.
> > >
> > > Would you define the validators and filters for the username field in
> > > all three forms? If you want to change these rules for the username
> > > field you need to change these definitions in each form, don't you?
> > >  
> >
> > I typically define forms explicitly as discrete classes -- and the same
> > for elements. What I would suggest is that if there are common elements
> > you use across multiple forms that will be using the same
> > validators/filters/decorators/etc... then create a custom element:
> >
> >  class My_Form_Element_Username
> >  {
> >  public function init()
> >  {
> >  $this-> addValidators(array(
> >  'Alnum',
> >  array('StringLength', false, array(6, 20)),
> >  ));
> >  $this-> setRequired(true);
> >  }
> >  }
> >
> > In your form classes, use these custom elements. That way, if you change
> > the rules for a single element type, it will propogate to all forms that
> > use it.
> >
> >
> > > And how do you handle different forms for the same model, say the create
> > > form is different than the update form?
> > >  
> >
> > A single model can certainly have multiple forms -- the example I
> > displayed was just a simple one.
> >
> > Have a getter for each form, or have getForm() accept an argument
> > indicating the form to retrieve.
> >
> >
> Wouldn't be better a reversed relationship, i.e. a series of forms have  
> a setter setModel() and the whole validation
> logic is inside the model (the place that I think is the most appropriate) ?
>
> Ralf said "And how do you handle different forms for the same model, say  
> the create
>
> form is different than the update form?"
>
>
> IMHO this is a case where validation should stay in the model and the  
> form would have access to the validators
> in the model. Also, there is no need to duplicate a setForm() method or  
> add parameters to it.
> I came to this conclusion after I realized that Zend_Form is just a very  
> specialized controller + view. The only thing
> missing is the model.

It really depends on your point of view; I can see arguments for either
case. When I was developing Zend_Form, I made a conscious decision that
both Zend_Form and Zend_Form_Element would implement
Zend_Validate_Interface -- so that they could be used as
validation/filter chains for models. When you think of forms this way,
then what you're suggesting is still true: validation logic is inside
the model, and encapsulated in its own object.

I would argue that forms aren't really controllers -- they know nothing
about their environment, whereas a controller does. You must pass them
data to process. That said, I can see how the presence of decorators can
make this less obvious.

The other reason I'd argue against passing the model into the form is
for use with services. As an example, in the pastebin demo I referenced
earlier, I was able to expose my models as services very trivially in
large part due to the fact that validation was self-contained in the
models via the form objects. This is a great way to re-use and
re-purpose models for a variety of domains.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


[fw-general] ZF 1.7.1 sanity check packages

2008-11-28 Thread Alexander Veremyev
Hi all!

The sanity check packages for ZF 1.7.1 are now available here:

http://framework.zend.com/releases/preview/ZendFramework-1.7.1.tar.gz
http://framework.zend.com/releases/preview/ZendFramework-1.7.1.zip
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-apidoc.ta
r.gz
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-apidoc.zi
p
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-de
.tar.gz
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-de
.zip
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-en
.tar.gz
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-en
.zip
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-fr
.tar.gz
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-fr
.zip
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-ja
.tar.gz
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-ja
.zip
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-ru
.tar.gz
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-ru
.zip
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-zh
.tar.gz
http://framework.zend.com/releases/preview/ZendFramework-1.7.1-manual-zh
.zip


README.txt is the only thing which is still not updated there (1.7.0
version is used).

Note that this is *NOT* the official release of 1.7.1. If we find no
major issues with these builds, we will issue official 1.7.1 release
from this tag soon. 
Please do *NOT* log any issues found in these archives in the issue
tracker; instead post any major functional or packaging issues to this
list or mail them to me directly ([EMAIL PROTECTED]).


With best regards,
   Alexander Veremyev.


Re: [fw-general] How to store attachment files into a location in server

2008-11-28 Thread j5

Perhaps Anees is looking for an efficent file storage algorithm? In order to
organize the attachment files on the server so you wont run into max file
per directory limits?

If so, I am looking for some ideas on this as well.


Anees wrote:
> 
> Hi
> 
> i am developing a module that sores all emails coming to an account into a
> database
> and i have succeeded in that using Zend_Mail_Storage_Pop3 calss
> 
> and also i am getting the information about the attachments that sending
> with mail
> i can display it, download it.. (using header() function )
> 
> But i need to store the file into a location in server
> how i can do this?
> 
> please help
> 
> Regards,
> Anees
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-store-attachment-files-into-a-location-in-server-tp20732847p20740201.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] ZF and SAP

2008-11-28 Thread mbneto
Hi,

I am looking for information regarding developing PHP applications to access
SAP.  I found some links like http://saprfc.sourceforge.net/ and
http://it.toolbox.com/blogs/php-sap-dev and in one of them (
http://it.toolbox.com/blogs/php-sap-dev/php-and-sap-23442) they've mentioned
Zend having a look

I was wondering if we have anything new about this (using Zend) or even
other resources about the usage, installation etc (perhaps off list in this
case).

Thanks.


[fw-general] Working progressbar demo

2008-11-28 Thread Isaak Malik
Hey,

Does anyone have a live working demo of the new Zend_Progressbar class they
can share? I can't seem to get the included demo working on Windows, it
keeps giving me an "undefined" javascript alert error.

-- 
Isaak Malik
Web Developer


[fw-general] Zend Auth: Advanced Usage By Example

2008-11-28 Thread dele454

Am trying to implement a similar scenario where if the column IsActive is set
to '0' the authentication should fail. A typical scenario is when a user
just signed up and still needs to active acct before allowed to gain access.

I followed the instruction in the Ref Guide but it isnt working. If the user
supplies email+password before acct is activated - login is granted.

The only code i didnt implement from the advanced useage example is the
MD5(?) because i have something similar implemented already. Except if it
does something else - i cant loggin with any credentials if i include it
though


$db= Zend_Registry::get('db');
$authAdapter = new Zend_Auth_Adapter_DbTable($db, 'Members',
'Email', 'Password', 'AND IsActive != "0"');

$config = Zend_Registry::get('config');
$password = $logins['password'];
$salt = "$^&##&@";
$password = md5($salt.$logins['password']);

$authAdapter->setIdentity($logins['email']);
$authAdapter->setCredential($password);
return $authAdapter;

Please help is needed thanks :)

-
dee
-- 
View this message in context: 
http://www.nabble.com/Zend-Auth%3A-Advanced-Usage-By-Example-tp20740513p20740513.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] QUestion about Classes

2008-11-28 Thread luisfqr

I'm trying to make a form, and I have this:

class chartsController extends Zend_Controller_Action 
{ 
public function indexAction()
{ 
$this->view->charts = "columnone";
}

public function columnoneAction()
{ 

   $form = new forms_ContactForm();

   }
}

So when I use $form = new forms_ContactForm(); it should be crating a form
based on what I have in applications/forms/contactForm.php right? But for
some reason I get this error:

Fatal error: Class 'forms_ContactForm' not found in
/home/hsphere/local/home/wwwuser/zend.bizhelper.com/application/controllers/ChartsController.php
on line 13 

or u can see it:

http://zend.bizhelper.com/charts/columnone


I'm real new with this =( Thank you for the help!!
-- 
View this message in context: 
http://www.nabble.com/QUestion-about-Classes-tp20740861p20740861.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] QUestion about Classes

2008-11-28 Thread Rolando Espinoza La Fuente
On Fri, Nov 28, 2008 at 5:42 PM, luisfqr <[EMAIL PROTECTED]> wrote:
[:::]
>
> Fatal error: Class 'forms_ContactForm' not found in
> /home/hsphere/local/home/wwwuser/zend.bizhelper.com/application/controllers/ChartsController.php
> on line 13
>

Afaik, zf does not auto-discover your forms or models, you can add
your forms path to your includes path in your bootstrap (not
recommended),
or include by hand in your controller:
 require_once APPLICATION_PATH . '/forms/ContactForm.php';

But the best option will be to use a helper/pluginloader. You can see
an implementation of this helper on "bugapp" zend application:
http://is.gd/9qty

-- 
Rolando Espinoza La fuente
Pro Soft Resources Inc.
www.prosoftpeople.com


Re: [fw-general] QUestion about Classes

2008-11-28 Thread luisfqr

Thank you Rolando. Like u said I just needed to inlcude the class:
require_once APPLICATION_PATH . '/forms/ContactForm.php'; 
and as u said  I will prefer to use the pluginloader script that u send me
THANK YOU very much for the quick answer!


Rolando Espinoza La Fuente wrote:
> 
> On Fri, Nov 28, 2008 at 5:42 PM, luisfqr <[EMAIL PROTECTED]> wrote:
> [:::]
>>
>> Fatal error: Class 'forms_ContactForm' not found in
>> /home/hsphere/local/home/wwwuser/zend.bizhelper.com/application/controllers/ChartsController.php
>> on line 13
>>
> 
> Afaik, zf does not auto-discover your forms or models, you can add
> your forms path to your includes path in your bootstrap (not
> recommended),
> or include by hand in your controller:
>  require_once APPLICATION_PATH . '/forms/ContactForm.php';
> 
> But the best option will be to use a helper/pluginloader. You can see
> an implementation of this helper on "bugapp" zend application:
> http://is.gd/9qty
> 
> -- 
> Rolando Espinoza La fuente
> Pro Soft Resources Inc.
> www.prosoftpeople.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/QUestion-about-Classes-tp20740861p20741270.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Working progressbar demo

2008-11-28 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Which exact OS / Browser are you using. I tested it on several browsers
and on several systems.
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::


Isaak Malik schrieb:
> Hey,
> 
> Does anyone have a live working demo of the new Zend_Progressbar class
> they can share? I can't seem to get the included demo working on
> Windows, it keeps giving me an "undefined" javascript alert error.
> 
> -- 
> Isaak Malik
> Web Developer
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkwfA0ACgkQ0HfT5Ws789BiZwCfY3BelzNWX7IlLRASvKPyhtC4
8bAAoIu6BLKYl633sGfjm2DR7z4X3ZOE
=3dX3
-END PGP SIGNATURE-


[fw-general] Zend/Transport/Sendmail.php not auto-included - Wanted behavior?

2008-11-28 Thread Thomas D.
Hello,

I am new to Zend Framework.

I tried to send an e-mail using Zend_Mail. I used your example [1], here's
my code:

setBodyText('This is the text of the mail.');
$mail->setFrom('[EMAIL PROTECTED]', 'Some Sender');
$mail->addTo('[EMAIL PROTECTED]', 'Some Recipient');
$mail->setSubject('TestSubject');
$mail->send($tr);
?>

Running this script will end in this error message:

Fatal error: Class 'Zend_Mail_Transport_Sendmail' not found in
/data/www/testweb/public_html/zendmail-test.php on line 4

When I add the line

require_once('Zend/Mail/Transport/Sendmail.php');

before the "new Zend_Mail_Transport_Sendmail" call, everything is working.

And that's the question:
Is that a wanted behavior/design?

I am new to Zend Framework, I would expect that it should be enough to just
include "Zend/Mail.php".

Also in line 723 in "Zend/Mail.php" there is a include... but it's too late.

Actual I don't understand, why you didn't include it with the other files in
line 26-41.


See also:
=
[1] http://framework.zend.com/manual/en/zend.mail.html


-- 
Regards,
Thomas




Re: [fw-general] Zend/Transport/Sendmail.php not auto-included - Wanted behavior?

2008-11-28 Thread Tim Nagel
You should take a look at the documentation for the Auto Loader.

http://framework.zend.com/manual/en/zend.loader.html (the quick start guide
has examples on it as well)


T

On Sat, Nov 29, 2008 at 10:24, Thomas D. <[EMAIL PROTECTED]> wrote:

> Hello,
>
> I am new to Zend Framework.
>
> I tried to send an e-mail using Zend_Mail. I used your example [1], here's
> my code:
>
>  require_once('Zend/Mail.php');
>
> // Set-up transporter
> $tr = new Zend_Mail_Transport_Sendmail('[EMAIL PROTECTED]');
>
> $mail = new Zend_Mail();
> $mail->setBodyText('This is the text of the mail.');
> $mail->setFrom('[EMAIL PROTECTED]', 'Some Sender');
> $mail->addTo('[EMAIL PROTECTED]', 'Some Recipient');
> $mail->setSubject('TestSubject');
> $mail->send($tr);
> ?>
>
> Running this script will end in this error message:
>
> Fatal error: Class 'Zend_Mail_Transport_Sendmail' not found in
> /data/www/testweb/public_html/zendmail-test.php on line 4
>
> When I add the line
>
> require_once('Zend/Mail/Transport/Sendmail.php');
>
> before the "new Zend_Mail_Transport_Sendmail" call, everything is working.
>
> And that's the question:
> Is that a wanted behavior/design?
>
> I am new to Zend Framework, I would expect that it should be enough to just
> include "Zend/Mail.php".
>
> Also in line 723 in "Zend/Mail.php" there is a include... but it's too
> late.
>
> Actual I don't understand, why you didn't include it with the other files
> in
> line 26-41.
>
>
> See also:
> =
> [1] http://framework.zend.com/manual/en/zend.mail.html
>
>
> --
> Regards,
> Thomas
>
>
>


Re: [fw-general] Zend/Transport/Sendmail.php not auto-included - Wanted behavior?

2008-11-28 Thread Michael Depetrillo
Thomas

In terms of performance it would not be a good idea to load
Zend_Mail_Transport_Sendmail automatically when you load Zend_Mail.

The reason is that a developer may want to use another Transport and it
would be inefficient to include _Sendmail automatically.

The include on line 723 is done when no transport is defined by the
developer.

You are defining your transport so you need to include statement.

Michael DePetrillo
[EMAIL PROTECTED]
Mobile: (858) 761-1605


On Fri, Nov 28, 2008 at 3:24 PM, Thomas D. <[EMAIL PROTECTED]> wrote:

> Hello,
>
> I am new to Zend Framework.
>
> I tried to send an e-mail using Zend_Mail. I used your example [1], here's
> my code:
>
>  require_once('Zend/Mail.php');
>
> // Set-up transporter
> $tr = new Zend_Mail_Transport_Sendmail('[EMAIL PROTECTED]');
>
> $mail = new Zend_Mail();
> $mail->setBodyText('This is the text of the mail.');
> $mail->setFrom('[EMAIL PROTECTED]', 'Some Sender');
> $mail->addTo('[EMAIL PROTECTED]', 'Some Recipient');
> $mail->setSubject('TestSubject');
> $mail->send($tr);
> ?>
>
> Running this script will end in this error message:
>
> Fatal error: Class 'Zend_Mail_Transport_Sendmail' not found in
> /data/www/testweb/public_html/zendmail-test.php on line 4
>
> When I add the line
>
> require_once('Zend/Mail/Transport/Sendmail.php');
>
> before the "new Zend_Mail_Transport_Sendmail" call, everything is working.
>
> And that's the question:
> Is that a wanted behavior/design?
>
> I am new to Zend Framework, I would expect that it should be enough to just
> include "Zend/Mail.php".
>
> Also in line 723 in "Zend/Mail.php" there is a include... but it's too
> late.
>
> Actual I don't understand, why you didn't include it with the other files
> in
> line 26-41.
>
>
> See also:
> =
> [1] http://framework.zend.com/manual/en/zend.mail.html
>
>
> --
> Regards,
> Thomas
>
>
>


Re: [fw-general] How to store attachment files into a location in server

2008-11-28 Thread Anees

Hi
Thanks for your reply Martin, Bruno n j5

I just read the messages of an email address using Zend_Mail_Storage_Pop3

$mail   = new Zend_Mail_Storage_Pop3(array('host'=>
host.com','user'=>'[EMAIL PROTECTED]','password'=>'pass'));

i took a particular message (it includes attachment)
$message = $mail->getMessage(3);

taken the second aray element of its
$part   = $message->getPart(2);

Took the content part of it
$content=base64_decode($part->getContent()); 

get content type, file name,..

$cnt_type  = explode(";" , $part->contentType);
$name   = explode("=",$cnt_typ[1]);

but couldnt able to store into any location

Though Bruno mentioned to store it into DB as blob, i prefer to store into
directory as files and just file name into DB. so that we can just dont want
to keep track other information like content type, size,etc..

i tried the normal PHP file writing code to write the data

$fh = fopen($name,'w') or die("can't open file");
fwrite($fh,$content);
fclose($fh);

but getting failed
i think am making some silly mistake somewhere

But still i am looking for native methods from Zend to manage file related
operations.

Regards
Anees
-- 
View this message in context: 
http://www.nabble.com/How-to-store-attachment-files-into-a-location-in-server-tp20732847p20743725.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to store attachment files into a location in server

2008-11-28 Thread Anees



Anees wrote:
> 
> 
> $fh = fopen($name,'w') or die("can't open file");
> fwrite($fh,$content);
> fclose($fh);
> 

Hi
there was a mistake where i used fopen.
I given the saving location as $sitename."/dir".$filename
instead
$_server['DOCUMENT_ROOT']."/dir/".$filename

Thanks

again
i am looking for native methods from Zend to manage file related operations.


Anees
-- 
View this message in context: 
http://www.nabble.com/How-to-store-attachment-files-into-a-location-in-server-tp20732847p20744033.html
Sent from the Zend Framework mailing list archive at Nabble.com.