Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Css webtools 3.1.2 is not loaded

I have just enabled the webtools in a new project of version 3.1.2 but does not load the CSS, the design was not loaded, only the simple page appears. My operating system is windows 10: The address of my path is

C: \ phalcon-devtools \ phalcon-devtools-master

And it is correctly added because if I let it enable it normally



62.9k
edited Apr '17

create a vhost and open it this way, now like c:\www.....\index.html



2.9k

I'm unfamiliar with developing on win10, but depending on your web server (nginx, apache), you can create a virtual host. It's most likely not loading the styles because of a path issue.

Remember, once you've done that, you need to change your C:\Windows\System32\drivers\etc\hosts file



4.0k
Accepted
answer
edited Apr '17

I had the same. You need to add a static URI

in config.php i put it under application

return new \Phalcon\Config([
    'database' => [
        'adapter'     => 'Mysql',
        'host'        => 'localhost',
        'username'    => 'root',
        'password'    => '',
        'dbname'      => 'phalcon-time',
        //'charset'     => 'utf8_general_ci',
    ],
    'application' => [
        'appDir'            => APP_PATH . '/',
        'controllersDir'    => APP_PATH . '/controllers/',
        'modelsDir'         => APP_PATH . '/models/',
        'viewsDir'          => APP_PATH . '/views/',
        'pluginsDir'        => APP_PATH . '/plugins/',
        'formsDir'          => APP_PATH . '/forms/',
        'formsElementsDir'  => APP_PATH . '/forms/elements/',
        'vendorDir'         => APP_PATH . '/vendor/',
        'cacheDir'          => BASE_PATH . '/cache/',
        'baseUri'           => '/phalcon-time/', 
        'staticUri'         => '/phalcon-time/' // <------------------------------------------- here
    ],
    'settings' => [
        'development'    => TRUE,
    ]
]);

If that doesnt work add also the base URI

$di->setShared('url', function () {
    $config = $this->getConfig();

    $url = new UrlResolver();
    $url->setBaseUri($config->application->baseUri);

    return $url;
});

The credits go to this answer though. Thats what i found to solve it: https://forum.phalconphp.com/discussion/15111/webtools-can-not-load-css-if-using-different-baseuri

Hello. This problem was solved. Could you update your dev-tools and try again?