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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:29:21+00:00 2026-06-06T08:29:21+00:00

I’m having trouble wording my problem, so it’s been tough to search for an

  • 0

I’m having trouble wording my problem, so it’s been tough to search for an answer. Hopefully you’ll know how to help.

I am creating a CakePHP 2.1 Plugin that will interact with a series of its own Models:
– Friend
– Group
– User

Friend and Group are models that are created specifically for the Plugin, and they function within the plugin normally. However, the User model is really just an alias for some other table in the parent app.

So, if “My Awesome Application” decides to use “My Awesome Plugin”, it will have to have its own “users” table (though it may called something else). Let’s say “My Awesome Application” has a Model called MyUser. “My Awesome Plugin” wants to dynamically tell its internal User model to $useTable = “my_users”.

My question is, how do I pass that data to the Plugin? How do I configure “My Awesome Plugin” to understand that User should $useTable “my_users”;

  • 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-06T08:29:26+00:00Added an answer on June 6, 2026 at 8:29 am

    As I understand you would like a Model in a PlugIn to use a table that would typically belong to a Model in your Application – by the conventions. Have you tried statically setting:

    public $useTable = "my_users";
    

    in the plugin? All plugins usually get initialized when Cake starts up, so all configurations should be loaded then. Why do you need this – it does really restrict you a lot? Will the table being used by the Plugin model change runtime?

    The Model class also has some goodies you may find useful:

    $this->User->table;
    

    holds the table name for the model – the table that is currently being used that is**.

    Also you can set the source table for the Model (inside a Controller) with:

    $this->User->setSource(‘table_name);

    ** I am not sure if this applies when you use Model::setSource(). It would be interesting to check out what $this->User->table; holds after a Model::setSource() call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have been unable to fix a problem with Java Unicode and encoding. The
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
This could be a duplicate question, but I have no idea what search terms
I've tracked down a weird MySQL problem to the two different ways I was
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.