Note that there are some explanatory texts on larger screens.

plurals
  1. POSymfony2 - assetic background images on subdomain
    primarykey
    data
    text
    <p>I have two bundles in Symfony 2.2</p> <p><em>1. FrontBundle on domaint.tld</em></p> <ul> <li>domain.tld/symfony/src/Comapny/FrontBundle/Resources/public/css</li> <li>domain.tld/symfony/src/Comapny/FrontBundle/Resources/public/images</li> <li>domain.tld/symfony/src/Comapny/FrontBundle/Resources/public/js</li> </ul> <p><em>2. AdminBundle on admin.domain.tld</em></p> <ul> <li>domain.tld/symfony/src/Comapny/AdminBundle/Resources/public/css (custom.css)</li> <li>domain.tld/symfony/src/Comapny/AdminBundle/Resources/public/images (image.png)</li> <li>domain.tld/symfony/src/Comapny/AdminBundle/Resources/public/js</li> </ul> <p><em>domain.tld/symfony/src/Comapny/AdminBundle/Resources/public/css/custom.css</em></p> <pre><code>div.image { background-image: url(../images/image.png); } </code></pre> <p><em>domain.tld/symfony/app/config/config.yml</em></p> <pre><code>debug: "%kernel.debug%" use_controller: false bundles: [ AdminBundle, FrontBundle ] read_from: "%kernel.root_dir%/../../public_html/" write_to: "%kernel.root_dir%/../../public_html/" filters: cssrewrite: ~ </code></pre> <p><em>domain.tld/symfony/app/config/routing.yml</em></p> <pre><code>admin: host: "admin.domaint.tld" resource: "@AdminBundle/Controller/" type: annotation front: host: "domain.tld" resource: "@FrontBundle/Controller/" type: annotation </code></pre> <p><em>domain.tld/symfony/src/Company/AdminBundle/Resources/views/layout.html.twig</em></p> <pre><code>{% stylesheets 'bundles/admin/css/custom.css' filter='cssrewrite,?yui_css' %} &lt;link rel="stylesheet" href="{{ asset_url }}"/&gt; {% endstylesheets %} </code></pre> <p>i use</p> <pre><code>app/console cache:clear app/console assets:install ../public_html --symlink app/console assetic:dump </code></pre> <p>--</p> <p><strong>PROBLEM</strong></p> <p>On domain.tld works everything OK, but problem is on subdomain.</p> <p>source code from admin.domain.tld </p> <pre><code>&lt;link rel="stylesheet" href="/css/8d488cd_custom_11.css"/&gt; </code></pre> <p>8d488cd_custom_11.css</p> <pre><code>div.image { background-image: url(../../bundles/admin/images/image.png); } </code></pre> <p>from firebug</p> <pre><code>"NetworkError: 404 Not Found - http://admin.domain.tld/bundles/admin/images/image.png" </code></pre> <p><strong>Any idea how to correct code or configuration to (css backgrounds) working for subdomain and root domain too ?</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload