Hi,
I've got problems using baseUri
(or maybe I'm searching in the wrong place) in a config file.
I use the phalcon-devtools to generate the project and files.
As I am working on WAMP, my project's url is localhost/myproject
.
The problem
Here is my problem, I'm trying to put some CSS / JS or some link in the volt files like this :
{{ stylesheet_link('css/bootstrap/bootstrap.min.css') }}
{{ link_to('test', 'test') }}
{{ javascript_include('js/jquery.min.js') }}
But the generated HTML is like this, with all the link with /public/
:
<link rel="stylesheet" type="text/css" href="/public/css/bootstrap/bootstrap.min.css">
<script type="text/javascript" src="/public/js/jquery.min.js"></script>
<a href="/public/test">test</a>
But I was expecting to have /myproject/public/
like this :
<link rel="stylesheet" type="text/css" href="/myproject/public/css/bootstrap/bootstrap.min.css">
<script type="text/javascript" src="/myproject/public/js/jquery.min.js"></script>
<a href="/myproject/public/test">test</a>
The files
In my config.ini
, I've got :
[application]
controllersDir = ../app/controllers/
modelsDir = ../app/models/
viewsDir = ../app/views/
pluginsDir = ../app/plugins/
libraryDir = ../app/library/
cacheDir = ../app/cache/
baseUri = /myproject/
In my services, I've got this, the load of the url component :
use Phalcon\Mvc\Url as UrlResolver;
$di->set('url', function () use ($config) {
$url = new UrlResolver();
$url->setBaseUri($config->application->baseUri);
return $url;
});
Here is my .htaccess
:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</IfModule>
Any help would be welcome,
Thanks.