Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2008
    Posts
    27
    Plugin Contributions
    0

    Default Where should I put my php/javascript files?

    As we know, there are 3 user folders: languages, modules, templates.

    I want to know which best folder to put my php or javascript files that contain functions or business logic?

    For example, I modify the tpl_header.php by adding this code:
    Code:
    <table border="0">
    <tr>
         <td valign="bottom" align="right" class="time">
              <?php include('time.php'); ?>
         </td>
    </tr>
    </table>
    You could see that I've include 'time.php'. It contains javascript codes to display the current time.

    So, where should I put the 'time.php' and what zen cart function to include the file?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Where should I put my php/javascript files?

    Scrap the tables!!!

    All you need is this in a div where you want it to appear
    Code:
    ?php echo time
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Nov 2008
    Posts
    27
    Plugin Contributions
    0

    Default Re: Where should I put my php/javascript files?

    You got me wrong. It's not about to display time but where should I put my php files that will be included by another files.

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Where should I put my php/javascript files?

    There are various places

    The modules/ is a good place for modules
    functions/ is a good place for functions
    for js, you can put it in modules/pages/somepage/(check the default pages for example)
    Otherwise, if the js is global, just place it in the js folder in the template folder.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    Nov 2008
    Posts
    27
    Plugin Contributions
    0

    Default Re: Where should I put my php/javascript files?

    Quote Originally Posted by yellow1912 View Post
    There are various places

    The modules/ is a good place for modules
    functions/ is a good place for functions
    for js, you can put it in modules/pages/somepage/(check the default pages for example)
    Otherwise, if the js is global, just place it in the js folder in the template folder.
    Thanks. That's clear my doubt. I thought it's not recommended to add files in that folder (especially modules/ and functions/).

  6. #6
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Where should I put my php/javascript files?

    In functions, you have extra_functions folder, in modules you can use override if you have to.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

 

 

Similar Threads

  1. How to put Javascript inside PHP?
    By bhensarl in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 27 Feb 2010, 07:07 AM
  2. Replies: 2
    Last Post: 24 Mar 2009, 10:15 PM
  3. Where should I put PDF files?
    By TonyBenedetti in forum General Questions
    Replies: 5
    Last Post: 5 Oct 2007, 10:34 PM
  4. Where should I put this javascript?
    By yellow1912 in forum General Questions
    Replies: 1
    Last Post: 14 Jul 2007, 10:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR