Wrong generated path by stylesheetLink() or javascriptInclude() when working inside userdir

I'm testing under the url 'http://localhost/~kiang/biz/'

When trying to use Volt, ```php {{ stylesheet_link("bootstrap/css/bootstrap.min.css") }} ```

be compiled as ```php <?php echo Phalcon\Tag::stylesheetLink('bootstrap/css/bootstrap.min.css'); ?> ```

and returned ```php <link rel="stylesheet" href="/biz/bootstrap/css/bootstrap.min.css" type="text/css" /> ```

The '/~kiang' was missing.

What is your baseUri set to?

$this->di['url'] = function () {
            $url = new \Phalcon\Mvc\Url();
            $url->setBaseUri("/~kiang/");
            return $url;
        };


1.3k

Thanks. I didn't know about this setting before.

My site is giving this error when mounting, only now I configured like this:

$di->set('url', function() use ($config){ $url = new \Phalcon\Mvc\Url(); $url->setBaseUri($config->application->baseUri); return $url; });

And put in config.ini: baseUri = /testeapp/

Only instead of riding www.testeapp.com/css he rides www.testeapp.com/testeapp/css and gives error, this error only occurs in production



82.2k

@André it seems that $config->application->baseUri is null or empty, can you check that?

I took a die and correctly returns the set value in config.ini /testeapp/ , the production server is linux and windows site is.



82.2k

Ah, baseUri must be "/" in production