My mistake. You shouldn't be overriding the Model::schema() function,
only the $_schema protected variable.

-J.

On Oct 1, 10:07 pm, sniper <[EMAIL PROTECTED]> wrote:
> the prblem is not saving, its in my cheer.ctp when i call echo 
> $form->create('Cheer');
>
> its throwing fatal error. i am expecting
> //Output:
> <form id="CheerAddForm" method="post" action="/cheers/add">
> but instead its
> Fatal error: Call to a member function schema() on a non-object in C:
> \xampp\htdocs\cake_1.2.0.7296-rc2\cake\libs\view\helpers\form.php on
> line 127
> how do i fix this?
>
> On Oct 1, 8:31 pm, Joel Perras <[EMAIL PROTECTED]> wrote:
>
> > You're already half way there by overriding the model schema function.
> > Which other model function do you think you should override so that
> > you can *save* the data to an external webservice?
>
> > -J.
>
> > On Oct 1, 4:38 pm, sniper <[EMAIL PROTECTED]> wrote:
>
> > > thanks for the reply, i tried that too, but it still doesn't work and
> > > looks like html, form helpers are built in , at least html works, you
> > > dont have to include for CakePhp1.2
> > > my saving and retrieving of data is done through webservice/soap. i am
> > > going to impl the save and find in my cheer model.
>
> > > But i am not sure how to do data structure?
>
> > > On Oct 1, 9:03 am, techiguy <[EMAIL PROTECTED]> wrote:
>
> > > > sniper,
>
> > > > you are saying u dont want 2 use database/tables and ur using a method
> > > > to save the data.
>
> > > > then where it will save?
>
> > > > any how i am thinking that u have missed one parameter in...
>
> > > > $helpers = array('Form','Html');
>
> > > > Html is missing?
>
> > > > hope it works.
>
> > > > On Sep 30, 7:15 pm, sniper <[EMAIL PROTECTED]> wrote:
>
> > > > >  Hi
> > > > > I am not sure if this has already been asked, but i couldnt find the
> > > > > answer anywhere sad.gif
>
> > > > > Anyway my question is
> > > > > i have a controller,model and view
> > > > > i dont want to use database/tables since persistance will be
> > > > > webservice(soap) based.
> > > > > and i am using cake_1.2.0.7296-rc2.
> > > > > PHP Code
> > > > > <?php
>
> > > > > /**
> > > > > * cheers_controller.php
> > > > > */
> > > > > class CheersController extends AppController {
>
> > > > > //it seems to work without defining this, but nevertheless:-/
> > > > > $helpers = array('Form');
> > > > > function add(){
>
> > > > >         if (!empty($this->data)) {
>
> > > > >             if ($this->Cheer->save($this->data)) {
> > > > >                 $this->flash('Your post has been saved.', '/cheers');
> > > > >             }else
> > > > >             {
> > > > >                 $this->flash('Your post has NOT been saved.', '/
> > > > > cheers');
> > > > >             }
> > > > >         }
> > > > >     }
>
> > > > > }
>
> > > > > /**
> > > > > * cheer.php
> > > > > */
> > > > > class Cheer extends AppModel
> > > > > {
> > > > >     var $name = "Cheer";
> > > > >     var $useTable = false;
>
> > > > > }
>
> > > > > /**
> > > > > * add.ctp
> > > > > */
> > > > > echo $form->create('Cheer');
>
> > > > > ?>
>
> > > > > throws this error
> > > > > CODE
>
> > > > > Fatal error: Call to a member function schema() on a non-object in C:
> > > > > \xampp\htdocs\cake_1.2.0.7296-rc2\cake\libs\view\helpers\form.php on
> > > > > line 127
>
> > > > > what more do i need to do? after much googling it looks like i have to
> > > > > override schema() function in my model.
> > > > > but i cant seem to figure out how? i tried to return a array but still
> > > > > doesnt work
> > > > > PHP Code
> > > > > <?php
>
> > > > > /**
> > > > > * cheer.php
> > > > > */
> > > > > class Cheer extends AppModel
> > > > > {
> > > > >     var $name = "Cheer";
> > > > >     var $useTable = false;
> > > > >     var $_schema = array(
> > > > >          'uid' => array('type' => 'string','null' => 1, 'default' =>
> > > > > '','length' => 30),
> > > > >          'msg' => array('type' => 'string','null' => 1, 'default' =>
> > > > > '','length' => 30),
> > > > >            'senderId' => array('type' => 'string','null' => 1,
> > > > > 'default' => '','length' => 30)
> > > > >         );
> > > > >     function schema($field = false)
> > > > >     {
> > > > >         return $this->_schema;
> > > > >     }
>
> > > > > }
>
> > > > > ?>
>
> > > > > Any help, direction would be a greatly appreciated.
> > > > > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to