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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:41:07+00:00 2026-05-25T03:41:07+00:00

I have legacy code which stores temporary data in the context. I would like

  • 0

I have legacy code which stores temporary data in the context. I would like to store this in the DB using the following model:

class Model_MyModel extends Model_Table {
    function init(){
        parent::init();
        $this->addField('myString');
    }   
}

I can access the data from within the legacy Controller thus:

class Controller_LegacyController extends Controller {
    $myString = $this->api->recall("legacyString");
}

But I can’t see how to tie everything together (all the examples use a Form to link to the DB)

Thanks for your help,

Greg.

  • 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-25T03:41:07+00:00Added an answer on May 25, 2026 at 3:41 am

    I find your question and code a bit confusing, but I’ll try to help.

    1. You don’t need controller to be able to use your model. When calling $form->setModel() it automatically pick the right controller for you.

      $page->add(‘MVCForm’)->setModel(‘MyModel’);

    2. When you want to send data back into data-base, you should call $form->update(). There is a View you can use, which will do that for you called: FormAndSave

      $page->add(‘FormAndSave’)->setModel(‘MyModel’); // will also save data back to database.

    3. If you load data from database, you need to call loadData() on the model. Your final code might look like this (stickyGET ensures that it pass get argument inside form submit handler):

      $this->api->stickyGET(‘id’);
      $page->add(‘FormAndSave’)->setModel(‘MyModel’)->loadData($_GET[‘id’]);

    4. method recall() deals with sessions, so it seems as if you are reading data from the session. If you intend that and you want to see value of your session variable in the form, then this will do it:

      $form->set(‘myfield’,$this->api->recall(‘legacyString’));

    I hope this will give you some hints on how to continue. Look through more samples, there are lots of them on http://agiletoolkit.org

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

Sidebar

Related Questions

I have this legacy code which embeds an SWF into an HTML using an
I have a lot of legacy code which I currently compile using an antiquated
I have some legacy Java code inside which I'd like to call a groovy
We have some legacy code that needs to identify in the Page_Load which event
Presently I have a some legacy code, which generates the op code. If the
I need to integrate some legacy 32-bit code - for which I don't have
I have legacy C# code and I am using Visual Studio 2008. I am
I have this legacy code base (Compaq PERL) , about 1500 lines of code,
I have this legacy code that I am working with and there is code
I have legacy code which I need to improve for performance reasons. My application

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.