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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:26:05+00:00 2026-06-11T10:26:05+00:00

I view my PHP code and JS code as one cohesive unit. I want

  • 0

I view my PHP code and JS code as one cohesive unit. I want to begin there interaction by creating an object on the client that looks like the structure below.

By doing this I only have to pass around one object. Sometimes all of the fields are populated, sometimes only 2 or more of the fields are populated.

So by trading off some wasted object properties, I only have to concern myself with passing o_p to different modules with in the MVC on the client and server.

I have functions to convert JavaScript to JSON to PHP.

Is this a valid approach?

Mo.o_p = function (type) {
    return {

        // current result or data about the data

        result :  0,

        // send client data

        client :  {
            model :  type,
            page  :  {},
            args  :  {}
        },

        // returned server data

        server :  {
            bookmarks  :  {},
            tweets    :  {},
            smalls    :  {}
        }
    };
};
  • 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-11T10:26:06+00:00Added an answer on June 11, 2026 at 10:26 am

    If your model requires these attributes and being empty is an important information for your application, i see no problem there. On the other hand, if your client and server objects are not necessarily connected and handled by different processes, there would be no need to couple them. Just passing some empty attributes should not be a performance problem.

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

Sidebar

Related Questions

I have something like the following code in one of my views: <?php $this->load->view('_validation_error',
Say I have this line of code in the view. <?php echo CHtml::activeTextField($model,'start_time'); ?>
I used AkismetComponent in AkisHelper and my AkisHelper code is: <?php App::uses('AppHelper', 'View/Helper'); class
I have this chunk of javascript that's kind of hacked around from http://www.developphp.com/view.php?tid=1248 and
I have a simple query (in a mySQL view) that php is using to
I want to rewrite core/adminthtml/block/widget/tabs.php class which is a super class for core/adminhtml/block/sales/order/view/tabs.php class.
Picture of the android interface: http://tinypic.com/view.php?pic=avht6w&s=6 As seen in the picture above I want
All the popular PHP frameworks today use their own view layer implementation that is
I have this code to display the data retrieved from DB in accounts_view.php :
Has anyone of you ever used php_writeexcel (http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/)? I would like to know if

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.