Yii Framework Forum: Nested modules with the same name - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Nested modules with the same name Rate Topic: -----

#1 User is offline   florianwalter 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 09-February 10

Posted 16 June 2010 - 12:43 PM

Hi all,

in our application we want addon-modules to carry their backend inside of a nested-module.
So every addon-module with a backend would have a module called 'backend'.

addonModule1
	controllers
	modules
		backend
			controllers
			views
	views
addonModule2
	controllers
	modules
		backend
			controllers
			views
	views


In the documentation is written: "A module is organized as a directory whose name serves as its unique ID."
We tried it anyhow and it seems to work, even though there are multiple modules called 'backend'.

Does anybody know about any side-effects, when having multiple modules with the same name?
Or isn't the unique ID mandatory for nested modules?

Thanks, Florian.
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 17 June 2010 - 03:07 AM

One side effect you should be aware of:

Quote

Additionally, if the application uses modules, a root alias is also predefined for each module ID and refers to the base path of the corresponding module. This feature has been available since version 1.0.3.


So you will probably not be able to use any root alias defined for your modules.
0

#3 User is offline   Junior - df9 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 416
  • Joined: 24-May 09
  • Location:Brazil

Posted 23 June 2010 - 05:53 AM

View Postflorianwalter, on 16 June 2010 - 12:43 PM, said:

Hi all,

in our application we want addon-modules to carry their backend inside of a nested-module.
So every addon-module with a backend would have a module called 'backend'.

addonModule1
	controllers
	modules
		backend
			controllers
			views
	views
addonModule2
	controllers
	modules
		backend
			controllers
			views
	views


In the documentation is written: "A module is organized as a directory whose name serves as its unique ID."
We tried it anyhow and it seems to work, even though there are multiple modules called 'backend'.

Does anybody know about any side-effects, when having multiple modules with the same name?
Or isn't the unique ID mandatory for nested modules?

Thanks, Florian.


I've been using exactly the same structure you mentioned in a little cms and have no issues till now.

I think this is a good and flexible structure because you can easily include and exclude modules for your clients' projects depending on their needs. Also, I've created a theme called "Backend", which is shared by backend submodules and created widgets in modules for flexibiliby in the frontend

It's not finished yet, but it has been working fine

regards!
______________________________________
Junior
df9.com.br
Linux Registered User #364954
GNU/Linux: together we're ready!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users