M
M
Monitorkin2016-04-04 18:18:59
Yii
Monitorkin, 2016-04-04 18:18:59

How do I get the controller to work in a subfolder of a view?

There is a pages module , it contains the AdminController controller and the controller views folder /pages/views/admin/
How can I make the controller work in the subfolder /pages/views/admin/config/ I
ask because I tried everything with zero result ..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DieZz, 2016-04-04
@DieZz

Why is the controller in the views folder?
In theory, the structure should be like this:
-modules/
--pages/
---controllers/
----AdminController.php
----AnotherController.php
---config/
----Config.php
---views/
----admin/
-----index.php
Config.php file code

<?php

namespace app\modules\pages\config

class Config 
{
    ...
}

Well, if you really want to put it in a directory with views, then write the namespace app\modules\pages\views\admin\config

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question