registerCssFile issue

i need to add a css file after asset bundle by using


$this->registerCssFile('css/user-panel.css',['depends'=>[AppAsset::className()]]);



. by using this all css file in asset will add but user-panel.css will show below content in firebug instead of its css lines !

by using absolute url every thing is right


$this->registerCssFile('http://localhost/sell/frontend/web/css/user-panel.css',['depends'=>[AppAsset::className()]]);

but whats wrong with relational url?

i appreciate any help.


<link rel="stylesheet" href="/css/user-panel.css">

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

<title>Object not found!</title>

<link rev="made" href="mailto:postmaster@localhost" />

<style type="text/css"><!--/*--><![CDATA[/*><!--*/

body { color: #000000; background-color: #FFFFFF; }

a:link { color: #0000CC; }

p, address {margin-left: 3em;}

span {font-size: smaller;}

/*]]>*/--></style>

</head>

<body>

<h1>Object not found!</h1>

<p>

The requested URL was not found on this server.

The link on the

<a href="http://localhost/sell/frontend/web/index.php%3fr=userpanel">referring

page</a> seems to be wrong or outdated. Please inform the author of

<a href="http://localhost/sell/frontend/web/index.php%3fr=userpanel">that page</a>

about the error.

</p>

<p>

If you think this is a server error, please contact

the <a href="mailto:postmaster@localhost">webmaster</a>.

</p>

<h2>Error 404</h2>

<address>

<a href="/">localhost</a><br />

<span>Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15</span>

</address>

</body>

</html>

</link>

Have you tried with a leading slash (assuming your css folder is root level) eg

$this->registerCssFile(’/css/user-panel.css’,[‘depends’=>[AppAsset::className()]]);

yes.but no chance!

if i dont use ‘depends’ option, relational path will work


$this->registerCssFile('css/user-panel.css')

but this is not what i want!