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

  • Home
  • SEARCH
  • 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 6021205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:40:45+00:00 2026-05-23T03:40:45+00:00

I have a local application that runs on multiple screens which I am in

  • 0

I have a local application that runs on multiple screens which I am in the process of moving over to cakePHP. Each screen represents a different view of a production line and has multiple items on each.

I need to refrenece some sort of controller wide function or array that defines the structure of my application, but I am unsure of the best way to do this. Since it will only be used in one controller, it seems excessive to create a global item. I thought I could include a simple array in the controller, outside of a function, and use it in each function. This didn’t work for some reason (probably a good reason).

$structure = array(
    'stage_1'=>array('duration'=>5,'temperature'=>293),
    'stage_2'=>array('duration'=>8, 'temperature=>'280),
    'stage_3'=>array('duration'=>3,'temperature'=>283)
);

So… What is the best way to create a controller wide array or function that can be referenced in the controllers view functions?

  • 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-23T03:40:46+00:00Added an answer on May 23, 2026 at 3:40 am

    Sounds like you forgot the var keyword or didn’t use $this->structure to call the variable.

    class ExamplesController extends AppController {
        var $name = 'Examples';
    
        var $structure = array(
            'stage_1'=>array('duration'=>5,'temperature'=>293),
            'stage_2'=>array('duration'=>8, 'temperature=>'280),
            'stage_3'=>array('duration'=>3,'temperature'=>283)
        );
    
        function action() {
            $this->set( 'structure', $this->structure );
        }
    }
    

    You might find reading up on object-oriented programming in PHP helpful when developing with CakePHP.

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

Sidebar

Related Questions

I have an application that runs transactions spanning over multiple databases on the same
I have an c# winform application that runs under a local account but needs
I have a windows service application that runs as Local System, and I want
We have an application that will be collecting data and storing it in local
I have an application that is launched from within a service using a local
I have a Clickonce application that is launched from the start menu (local). I
I have a JEE5 application that exposes services using (local) session beans. When an
I have a Rails application that lists information about local services. My objectives for
I have a .NET application that is meant to be run on a local
I would like to develop an Android application which will have a local database.

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.