Difference between #5 and #7 of
Organize directories for applications with front-end and back-end using WebApplicationEnd behavior

Changes

Title unchanged

Organize directories for applications with front-end and back-end using WebApplicationEnd behavior

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

Content changed

[...]
{
// ...

// We can configure our module depending on the value
// of Yii::app()->endName.
$this->foo = (Yii::app()->endName == 'front')
 ? 'bar1' : 'bar2';

// Raise onModuleCreate event.
[...]
```


 
<strong>CRUD management as frontend and backend</strong>
 
 
For backend crud generation run url as,<br />
 
/backend.php?r=gii<br />
 
controller generate as : controllers\back\XyzController.php<br />
 
view files generate as : views\back\xyz\files.php<br />
 
<br />
 
For frontend crud generation run url as,<br />
 
/index.php?r=gii/crud<br />
 
controller generate as : controllers\front\XyzController.php<br />
 
view files generate as : views\front\xyz\files.php<br />
 
 
 
## Summary

The created behavior delivers us from specifying controllers and views paths for the application and all it's modules by using runEnd() method and invoking the onModuleCreate event in necessary places.
[...]
```

But make sure that you insert these rules before news rules containing <_c> and <_a>. Otherwise the latter rules will be used instead.

 
26 0
44 followers
Viewed: 142 011 times
Version: 1.1
Category: Tutorials
Tags:
Written by: andy_s
Last updated by: kiran sharma
Created on: Feb 2, 2010
Last updated: 12 years ago
Update Article

Revisions

View all history