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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:01:15+00:00 2026-06-13T16:01:15+00:00

I’m developing a simple(!) 2 page application. Page1: Takes basic details from the user

  • 0

I’m developing a simple(!) 2 page application.

Page1: Takes basic details from the user about the program is creating for his trip – name of the trip, dates etc.

After clicking Save, a entry is created on MongoDB using controllers in Lithium PHP for the program. A id is generated and passed on to page 2 as a parameter in URL like so:

$this->redirect('/iplans/save/' . $program_id . '/' . $program_name);

Page 2: is a single page application using many Backbone scripts (hosted in individual js files) and allows the user to add datewise details of his program. No js script is in-line.

I want the backbone collection to be saved on the server side when Finish is pressed but need to send in the program_id with this collection so that the right program is updated in MongoDB.

Questions:

  1. How does one ensure that the program_id from lithium/php server side is picked up by backbone javascripts that are in their own js files (not inline)
  2. What other options are available besides Controller::redirect to forward the control from page1 to page2?
  3. What other options can be used to pass-on the program_id and any other values that may be needed to backbone/JS layer. Is there a standard-way of passing such items?
  • 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-13T16:01:15+00:00Added an answer on June 13, 2026 at 4:01 pm
    1. There are a couple of options:

      1. Parse out program_id from window.location.href
      2. Dynamicly create a bit of javascript in your lithium view. it could be as simple as:
        "<script> myvars = " . json_encode(array(...)) . "<script>"
        and then you can read the variables from the javascript.

      3. Create the onDomRady function dynamically from lithium

    2. That is a good way. That is, one page show form and receive data from the form, and one page that show some data. They are not related to each other, and it will make the code easy to understand.

    3. You could use AJAX/JSON to send/receive data to/from the server. Also see answer 1b,1c

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I don't have much knowledge about the IPv6 protocol, so sorry if the question

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.