Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8061319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:18:08+00:00 2026-06-05T10:18:08+00:00

my action.class.php if ($this->getRequest()->getMethod() == sfRequest::GET) { $this->formShoppingList = new ShoppingListForm(array( ‘shoppinglist’ => $items,

  • 0

my action.class.php

 if ($this->getRequest()->getMethod() == sfRequest::GET) {
                 $this->formShoppingList = new ShoppingListForm(array(
                        'shoppinglist' => $items,
                            ), array('shoppinglist_id' => $list_id));
}

    if ($request->isMethod('post')) {
        $this->formShoppingList->bind($request->getParameter('shoppinglist'));
     print_r($this->fromShoppingList;
    }

My lib/ShoppingListForm.php:

<?php

class ShoppingListForm extends BaseForm {

public function configure() {
    $shoppinglist_id = $this->getOption('shoppinglist_id');

    $this->setWidgets(array(
        'shoppinglist' => new sfWidgetFormTextarea(array(), array('rows' => '10', 'cols' => '35')),
        'action_id' => new sfWidgetFormInputHidden(array()),
        'list_id' => new sfWidgetFormInputHidden(array(),array('value' => $shoppinglist_id)),
    ));

    $this->widgetSchema->setLabels(array(
        'shoppinglist' => '',
    ));


    $this->setValidators(array(
        'shoppinglist' => new sfValidatorString(array('max_length' => 5000), array(
            'required' => 'ShoppingList is empty.'

        )),

        'action_id' => new sfValidatorString(array('required' => false)),
        'list_id' => new sfValidatorString(array('required' => false))

    ));

    $this->widgetSchema->setNameFormat('shoppinglist[%s]');

    gfFormHelper::addRequiredToLabel($this);
}

}

?>

When I submit the form, the error is coming up:

Fatal error: Call to a member function bind() on a non-object in….

Tampa-Data:
shoppinglist%5Bshoppinglist%5D=liste+15%0D%0A
shoppinglist%5Baction_id%5D=1
shoppinglist%5Blist_id%5D=15

Why? Solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:18:11+00:00Added an answer on June 5, 2026 at 10:18 am

    You need to create a instance of the ShoppingListForm before you bind it :

    if ($request->isMethod('post'))
    {
       // Create instance of ShoppingListForm here
        $this->formShoppingList = new ShoppingListForm();
        $this->formShoppingList->bind($request->getParameter('shoppinglist'));
        if ($this->formShoppingList->isValid())
        {
        // do something with the submitted data
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this HTML: <form action='uploadhandle.php' method='POST' enctype=multipart/form-data> <input type='file' class='fileinput' id='photo1' name='photo1'> <input
$(.blok).newWindow({ windowTitle:Example1, ajaxURL:Action.php?task=BlokDuzenleFormGetirBlokId=+$(.blok).attr('id') }); when first clicked on blok class a href, newWindow loads
I have the code: <div class='selectAnAction'> <ul> <li class='actionSelect'><span>Select an Action</span></li> <li class='action' onclick='location.href=\/post.php?key=.$row['hash'].\;'>post</li>
Basically this is what i want to do: <?php class App { public $var
I have this in my Controller. public function delete($id) { if($this->request->is('get')) { throw new
I have a action class for saving some data to a database.In action class
In my action class I have a Map<Long, Set<String>> attribute, named accountsMap. Lets say
I have the following index action: class ExpensesController < ApplicationController def index() @expenses =
I want to call outer class' method getContentPane() from inner Action class. I don't
I try to cast an object to my Action class, but it results in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.