Invalid Configuration

Why I am getting this error? I already have the assets folder with 777 permission. Help?

Have you definitely set that assets folder as 777? don’t forget there are two asset directories




basic/assets/

basic/web/assets/



Cheers

Ash

I’ve fixed it. I’m trying out the guide in the official docs. Creating action and view. I’ve followed everything right but I got this error. I can’t seem to find answers on the internet. I’m stuck here. :expressionless:

You need to post code so we can see what is causing the error, not just screenshots.

FYI you can use Gii controller generator which will make controllers and views for you. Worth checking GII in the docs




<?php


namespace app\controllers;


use yii\web\Controller;


class SiteController extends Controller

{

    // ...existing code...

    // I've added this line to SiteController.php

    public function actionSay($message = 'Hello')

    {

        return $this->render('say', ['message' => $message]);

    }

}







//created say.php in views/site

<?php

use yii\helpers\Html;

?>

<?= Html::encode($message) ?>



-Taken from here: http://www.yiiframework.com/doc-2.0/guide-start-hello.html

I’m starting from the very basic. And got an error right away.

I have found one issue, not sure if it is what is causing your problem (because I’ve copied your code into my project and it works) however from your screenshot it looks like you are loading to site/say.php. That throws errors on my setup:


Unable to resolve the request: site/say.php

The URLs that should work (if pretty URLs configured):




http://your-app/site/say

http://your-app/site/say/parsnip (would echo parsnip on your page)



The fact that your code, when copied into my project works - makes me think you may have some config/setup issues. Maybe location of yii\helpers\Html

Yep. That. It’s say it can’t be found. I didn’t change any location of the folders though. Frustrating.