kurkuma
(kurkuma)
1
It installs a project that is already exposed to the public. I have a few problems, many url works, but on which ones I have an error
View not Found – yii\base\ViewNotFoundException
The view file does not exist: /home/project_dir/web/app/index.html
I fire applications from apache2 locally
tri
(tri - Tommy Riboe)
2
You need to tell us more.
Is app your AppController and no action was specified in the url?
Read about two methods to render static pages:
https://www.yiiframework.com/doc/guide/2.0/en/structure-views#rendering-static-pages
tri
(tri - Tommy Riboe)
3
An example: let’s use ViewAction with about.php renamed to about.html and using pretty url format.
class SiteController extends Controller
{
public function actions()
{
return [
'page' => [
'class' => 'yii\web\ViewAction',
],
];
}
}
Add the view (about.html) to
views/site/pages/
Add a rule to urlManager component section in the config (web.php)
e.g
'static/<view:[\w\.]+>' => 'site/page',
Display the static page using this url
<server><the_project>/web/static/about.html
With the web folder as DocumentRoot
<server>/static/about.html