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

  • Home
  • SEARCH
  • 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 7248457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:08:27+00:00 2026-05-28T22:08:27+00:00

The scenario: I’m developing with Less CSS on a Cake App, and I want

  • 0

The scenario:
I’m developing with Less CSS on a Cake App, and I want to compile the less files client-side as they recommend in the documentation (I’m also on a git repo with several other programmers, so I want them to be editing the less files instead of the css…which gets overwritten when I recompile):

  <head> 
    . . .
    <link rel="stylesheet/less" type="text/css" href="styles.less">
    <script src="less.js" type="text/javascript"></script>
    . . .
  </head>

The problem:
I’m storing the less files in webroot/css/lib, and the less.js file in webroot/js/vendors and I want to use the HTML helper to build the link/script tags:

<?php echo $this -> Html -> css('lib/style.less'); ?>
<?php echo $this -> Html -> script('vendors/less-1.2.1.min.js');?>

There’s no problem loading the less.js. The issue lies in that with the css helper, Cake appends ‘.css’ to the end of the path.

The solution: … ?

  • 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-28T22:08:28+00:00Added an answer on May 28, 2026 at 10:08 pm

    the html helper will check if there’s a “?” in the filename.. if there isn’t, it adds “.css” at the end:

    cake/libs/view/helpers/html.php (ln. 356)

    if (strpos($path, '?') === false) {
        if (substr($path, -4) !== '.css') {
        $path .= '.css';
        }
    }
    

    maybe you can trick the helper with something like this:

    <?php echo $this -> Html -> css('lib/style.less?'); ?>
    

    but I’m not sure if it will work… you might have to write the tag manually =P

    Cheers

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

Sidebar

Related Questions

Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are
Scenario You've got several bug reports all showing the same problem. They're all cryptic
Scenario: I'm working on a rails app that will take data entry in the
Scenario is I've a big parking lot (with obstacles) and want to determine shortest
Scenario: I start out in my app's main page. I navigate to sub-page A,
Scenario: I've hundreds of applications instances running on client machines doing a certain job.
Scenario: I have got a client, php script and a MySQL database. I am
Scenario 1: Table: id column1 column2 1 bla foo 2 bla bar I want
Scenario: I have several services that I want to be discovered by different clients.
Scenario: I am writing a WCF client to access a Java/Metro webservice which requires

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.