Modules in YII2

Hi All,

I have created a module in yii2

frontend/modules/admin/

                   Controllers


                   Models


                   Views

I need to access the module admin index.php file.

my url is like this how to access module

localhost/advanced/frontend/web/index.php

Many Thanks.

You admin module does not have an ‘index.php’.

But the way to access a module is simply to put the name of the module before action/controller - so I guess the URL that you must use is ‘admin/default/index’.

See the Yii guide for details about modules.

http://www.yiiframework.com/doc-2.0/guide-structure-modules.html

My Module structure in frontend is

modules

  admin


   -Admin.php


   controllers


	-AdminController


   Models


	-Admin


   Views


	-Admin


		[u]-index.php[/u]

My url is is like http://localhost/advanced/frontend/web/index.php

Now my question is how can i access the index.php (which i underlined) via url.

Any configurations to be done?




http://localhost/advanced/frontend/web/index.php?r=admin/default/index



Depending on what your controller is called and what actions it has.

Thanks It’s Working.

Is any other alternative way to access modules dynamically?

Any config files to be update?