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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:34:36+00:00 2026-05-30T21:34:36+00:00

I want to add script files and css files to my php view page

  • 0

I want to add script files and css files to my php view page inside a module, I try to make like this

   <base href="<?php echo $this->baseUrl(); ?>" />
    <link rel="stylesheet" type="text/css"  href="<?php echo $this->baseUrl('style/ui-lightness/jquery-ui-1.8.18.custom.css'); ?>"/>

and like this

    <?php
    $this->headScript()->appendFile('js/jquery-1.7.1.min.js');
    echo $this->headScript();
    ?>

but both of them do not inlucde the files. I put my css and js files inside the helpers folder of view folder.

  • 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-30T21:34:37+00:00Added an answer on May 30, 2026 at 9:34 pm

    Your JS and CSS files are in the wrong place.

    The helpers folder of the the view folder isn’t even in the web root (by default), so you literally cannot request it from the web server.

    Put them somewhere under the web root, and then give a path to them in the view script.

    As your view script may be a few folders deep, I tend to use absolute paths. (/js/jquery…).

    You could alternatively programmatically calculate the absolute or relative path to the file and use it. (If you’re at controller1/ you’ll need to do ../js/jquery, but if you’re at controller1/action/ you’ll need to do ../../js/jquery.)

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

Sidebar

Related Questions

I want to add something like this to my page header, in order to
This is a crossbrowser window.onload script, I want to add a message, when the
I'm using PHP to send html emails. I've tried to import css files inside
I want to add a mailto link on our web page. I want to
I would like to add some files to the Compile Sources build phase using
I have this program and i want to add a jquery datepicker on it,
I want to add the following script in my action script for redirecting to
I have dbml with single table users i want add partial class for User
I have a website built with ASP.NET (3.5) and want add some level of
I have a list of string values that I want add to a hashtable

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.