great thanks for the info guys.  that helps a lot

On Feb 8, 11:18 pm, Miles J <mileswjohn...@gmail.com> wrote:
> Yes, anything to do with model/database logic should be placed in the
> model.
>
> The controller is used to pass the data from the model into the
> correct view.
>
> On Feb 8, 6:56 pm, dtirer <dti...@gmail.com> wrote:
>
> > Actually, just read something about putting such methods in the Model,
> > rather than the Controller
>
> > So my 'foreign' is_user() method should go in my User Model.  Since
> > all it does is check and pull info from the DB.
>
> > Does that make sense?
>
> > On Feb 8, 9:48 pm, dtirer <dti...@gmail.com> wrote:
>
> > > Here's my situation.  Users are searching for items.  I have an Items
> > > controller, and a Users controller.
>
> > > When a user enters the Item they want, and their email on the /items/
> > > index page, I first want to check if they are a user.
>
> > > So what seemed logical to me was something like the following:
>
> > > ItemsController extends AppController
> > > {
> > >         function index()
> > >         {
> > >                  if (!empty($this->data))
> > >                 {
> > >                          // See if the user email already exists in
> > > the DB
> > >                          if (!$user_id = 
> > > $this->Item->User->is_user($this->data['User']['email']))
>
> > >                         {
> > >                                    // then do this
> > >                         }
> > >                               // then process item search stuff
> > >               }
> > >        }
>
> > > }
>
> > > And of course, in the UsersController, I have an is_user() function
>
> > > However, I get an error SQL syntax errors where the foreign controller
> > > functions come up.  I know the foreign functions work cause I tested
> > > them standalone.
>
> > > Is this not the correct way to have this type of functionality?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to