Difference between #3 and #4 of
How to access a component of a module from within the module itself

Revision #4 has been created by Roman Solomatin on Feb 15, 2013, 6:58:45 PM with the memo:

Added another example of how to access module's components.
« previous (#3)

Changes

Title unchanged

How to access a component of a module from within the module itself

Category unchanged

Tutorials

Yii version unchanged

Tags changed

module

Content changed

[...]
You call it from within the module:

```php
Yii::app()->controller->module->foo
```
or
 
 
```php 
Yii::app()->getModule('module')->foo
 
```
 
As you can see, your module is indeed just another application, and you can configure any parameters as you'd do with your "root" application. The only organizational differences are: + a module has a module "entry point", the FooModule which extends CWebModule. Whereas the root application is bootstrapped by the framework itself, starting with your entry script (index.php) + the application's SiteController is called inside a module DefaultController
3 1
7 followers
Viewed: 60 717 times
Version: 1.1
Category: Tutorials
Tags: module
Written by: OriginalCopy
Last updated by: Roman Solomatin
Created on: Apr 7, 2009
Last updated: 11 years ago
Update Article

Revisions

View all history