Zend Framework: Creating a Form

Finally this Zend Framework quickstart/sample tutorial is over. At this last step of tutorial, I met error in very first command. The first command is: zf create form Guestbook.

Error is: PHP Fatal error: Call to a member function search() on a non-object in ..
when I used this command: zf create form Guestbook

Thankfully this time I could find solution so easily as one user has submitted the fix:

Here is a fix:
Go to the file: ZendFrameworklibraryZendToolProjectProviderForm.php mentioned in the error report itself.

Search for : "$testingEnabled = Zend_Tool_Project_Provider_Test::isTestingEnabled($this->_loadedProfile);"
inside function "public function create($name, $module = null)"
and write these lines:


// create forms directory if it doesn't exist
if (!($formsDirectory = self::_getFormsDirectoryResource($this->_loadedProfile, $module))) {
	$applicationDirectory = $this->_loadedProfile->search('applicationDirectory');
	$formsDirectory = $applicationDirectory->createResource('formsDirectory');
}

After this error, everything works as expected and final output, which is a form, is also working. The form is fully functional and it is showing data submitted on Guestbook form.

Check Zend Framework related errors and solutions for earlier tutorial pages on Zend Framework I have mentioned in my posts.

Comments are open for an year period. Please, write here on Facebook page.