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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:48:06+00:00 2026-05-13T11:48:06+00:00

Does anyone know how to add stylesheets in a template with Symfony 1.4 ?

  • 0

Does anyone know how to add stylesheets in a template with Symfony 1.4 ?

I have tried everything I can think of, from modifying frontend/config/view.yml to modifying the template itself – bothing works.

I have seen from my searches, that other people have had the same problem. There seems to be a clash of sorts between using include_stylesheets and use_stylesheets – however this is not documented anywhere AFAIK.

  • 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-13T11:48:06+00:00Added an answer on May 13, 2026 at 11:48 am

    Edit:

    Ok I think I got it now. You should add include_stylesheets() into the head section of your layout file:

    <html>
       <head>
           <title>This is the title</title>
           <?php include_stylesheets() ?>
       </head>
       <body>
       <!-- ... -->
    

    Then in your template file, you use use_stylesheet() to add a particular stylesheet for this template:

    <?php use_stylesheet('/path/to/stylesheet.css') ?>
    

    From the API documentation:

    include_stylesheets()
    Prints <link> tags for all stylesheets configured in view.yml or added to the response object.

    use_stylesheet()
    Adds a stylesheet to the response object.

    Same for Javascript.


    According to the API documentation it should still work in 1.4, sfWebResponse still has this method:

    addStylesheet ($file, $position, $options)   
      $file   The stylesheet file  
      $position   Position   
      $options    Stylesheet options  
    Adds a stylesheet to the current web response.
    

    At least the method exists.
    What exactly is the problem? Do you get an error if you want to call that method or is the stylesheet just not added?

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

Sidebar

Related Questions

Does anyone know how can I add an integer from another table to the
Does anyone know how to add a subversion branch to hudson and have it
hi does anyone know how to add audio to buttons i have added the
Does anyone know if it's possible to add VB to an Excel document, from
Does anyone know of a way in which I can add an extra database
Does anyone know how to add a generic principal to the HTTPContext from the
Does anyone know how to add a border to a Dockpanel. i have this:
Does anyone know how I can add a progress bar to a listview cell
Does anyone know how I can add a logo in the form of a
Does anyone know how to add an item to a list but do it

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.