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 7491901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:11:37+00:00 2026-05-29T16:11:37+00:00

I am a bit confused about how I can exchange information between controllers in

  • 0

I am a bit confused about how I can exchange information between controllers in CakePHP 2.0. This is basically what I am trying to do.

I have images db table that holds id,name,path, etc.
users table that holds user user, password, etc.

I have a model Image.php, a controller – ImagesController.php, and
views – View/Images/add.ctp View/Images/index.ctp View/Images/view.ctp

I have a model User.php, a controller – UsersController.php, and views
– View/Users/index.ctp, View/Users/login.ctp

My View/Images/index.ctp lists all the images that have been uploaded, View/Images/add.ctp lets anyone upload an image

View/Users/login.ctp lets the user log in and if it’s correct info, it sends the user to View/Users/index.ctp

1) How can I make View/Images/add.ctp be accessible only to users who are logged in. Should I redirect them to View/Images/add.ctp with user session information and check if the data is set or how does it work in CakePHP?

2) If I am updating an images table from Images using $this->Image->saveAll($data_s). How can I save some of the data into User table? I have looked at the documentation but a bit confused still.

  • 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-05-29T16:11:38+00:00Added an answer on May 29, 2026 at 4:11 pm
    1. Use the AuthComponent to handle authentication, which is really what you want.
    2. If the two models are associated, you can access one through the other. E.g. if Image belongsTo User, the User model is accessible from the Image model via a simple $this->Image->User. Otherwise, you can include any model in any controller using the $uses attribute or temporarily using the loadModel method.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a bit confused about how many controllers I need, and when I can
Can we override hardware back button functionality. I am bit confused about this kindly
I am a bit confused about this. If you're building a distributed application, which
I'm a little bit confused about simple program which I wrote, can You please
I'm a little bit confused about these two terms, can somebody explain what is
I am a bit confused about the difference between Silverlight and Expression Blend. From
i read Here and bit confused about the unregistering events. means i have button
i am a bit confused about threads. If i have a file server and
I'm a bit confused about what data structure I can use to be able
Im a bit confused about inherited instance variables in ABCs. I have written an

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.