Web Design Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignWeb Design Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 13th, 2008, 10:37 AM
achimpanzee achimpanzee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 1 achimpanzee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 27 sec
Reputation Power: 0
Question Recommendations on keeping PHP/JS in sync

I am planning a rather large site that will use PHP5 and JavaScript. It will also be using the CodeIgniter MVC framework.

I wanted to find from some other professionals what they have found to be the best way to keep configuration data synced between JavaScript and PHP. Specifically I would like to keep prices for the various services the site offers in some sort of configuration file, and have JavaScript and PHP both able to access that configuration (so if something changes I don't have to modify 2 different files - one for JavaScript and one for PHP).

I have seen some methods here that have PHP just echo out JS tags such as <script>MyConfig.foo = 'bar';</script> but I feel like that is a bit sloppy and there may be a better way. Due to the site's size I am more concerned about keeping the code organized and unobtrusive than a few milliseconds of performance time.

Does anyone have any recommendations of solutions they have used or a reference to something that may help me out? Thanks for the help!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignWeb Design Help > Recommendations on keeping PHP/JS in sync


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway