Thanks.  That seems to work much better.  Although I'm still not sure I
understand exactly why, considering that the component is part of the same
module that is trying to instantiate the LoginForm.

I am, however, having difficulty getting my component template to use a
slot.  Should it be able to?  I've included "use_helper( "partial" )" at the
top of the component template, and have the appropriate "slot()/end_slot()"
calls, but the content doesn't seem to be pushed into the appropriate slot
of the global layout.php template.

Is that expected behaviour from a component, or is there a problem with my
code?

Thx,

Eric



On Tue, Jan 11, 2011 at 11:32 AM, Gareth McCumskey <gmccums...@gmail.com>wrote:

> Stick that form into either root/lib or into root/apps/frontend/lib
>
> On Mon, Jan 10, 2011 at 10:01 PM, Eric B <ebenza...@gmail.com> wrote:
>
>> Hi,
>>
>> I've run into a problem with a component instantiating an existing form,
>> so it has prompted me to look into the autoloader to figure out why it isn't
>> seeing the class.  I've come to the conclusion that I can't seem to figure
>> either out.  So I guess this becomes a 2 part question; one is just a
>> request for help to see how/why to instantiate a form within my component,
>> and one to get a little more info on how the autoloader is supposed to find
>> the class.
>>
>> Part 1:
>>
>> My component is fairly simple:
>>
>> frontend/modules/secure/actions/components.class.php:
>> class secureComponents extends sfComponents
>> {
>>   public function executeLogin()
>>   {
>>     // instantiate the login form
>>     $this->login = new LoginForm();
>>   }
>> }
>>
>> frontend/modules/secure/lib/form/LoginForm.class.php:
>> class LoginForm extends sfForm
>> {
>>   public function configure()
>>   {
>>     $this->setWidgets( array(
>>       'email' => new sfWidgetFormInputText( array(), array( "required" =>
>> "true" ) ),
>>       'password' => new sfWidgetFormInputPassword( array(), array(
>> "required" => "true" ) ),
>>     ) );
>>     $this->setValidators( array(
>>       'email' => new sfValidatorEmail( array(), array( "invalid" =>
>> "Invalid email entered") ),
>>       'password' => new sfValidatorString(),
>>     ) );
>>
>>     $this->getWidgetSchema()->setNameFormat('login[%s]');
>>   }
>> }
>>
>>
>> My call to the component from within the layout template:
>> frontend/templates/layout.php:
>> <?php include_component( "secure", "login" )?>
>>
>> When I try to view any page, I get the following error message:
>> *Fatal error*: Class 'LoginForm' not found in *
>> E:\Dev\Projects\MIPP\apps\frontend\modules\secure\actions\components.class.php
>> * on line *13*
>>
>>
>> And thus, I started looking at the autoloader to determine why it isn't
>> finding the LoginForm in my component class.  But I can't figure out how the
>> autoloader is supposed to find the LoginForm class.  When I look at the
>> autoload/getClassPath() method in sfCoreAutoload I don't see how it is
>> searching for the LoginForm class.  I see the component calling the
>> getClassPath method by stepping through the code when it tries to
>> instantiate the LoginForm class, but it never finds it.
>>
>> Am I overseeing something simple somewhere?  Am I searching for something
>> in the wrong place?
>>
>> Thanks,
>>
>> Eric
>>
>>
>>
>>  --
>> If you want to report a vulnerability issue on symfony, please send it to
>> security at symfony-project.com
>>
>> You received this message because you are subscribed to the Google
>> Groups "symfony users" group.
>> To post to this group, send email to symfony-users@googlegroups.com
>> To unsubscribe from this group, send email to
>> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/symfony-users?hl=en
>>
>
>
>
> --
> Gareth McCumskey
> http://garethmccumskey.blogspot.com
> twitter: @garethmcc
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to