2amigos / yiinitializr

Library that will help boost your application installation with ease and also to run Yii applications from its bootstrap files on a much cleaner way that the framework currently proposes.
Other
44 stars 17 forks source link

Gii generator is broken #23

Open antonkomarev opened 10 years ago

antonkomarev commented 10 years ago

I've tried to use Gii and got an errors. So I've wrote a tiny step-by-step instruction how to fix generated content. Thats not a complete fix, but could be helpfull for a start.

I think Gii should be extended to make it automatically.

For example i've generated Model YiiLog & CRUD for it.


I've recieved an error:

include(Controller.php): failed to open stream: No such file or directory

In our generated controller class we need to change:

class YiiLogController extends Controller

to:

class YiiLogController extends EController

Then I've recieved an error:

Declaration of YiiLogController::loadModel() should be compatible with EController::loadModel($class, $id, $criteria = Array, $exceptionOnNull = true)

In our generated controller class we need to remove loadModel & performAjaxValidation functions, because they are implemented in EController already.


After that we need to rewrite each call of loadModel function in our controller.

Find every:

$this->loadModel($id)

Change to:

$this->loadModel('YiiLog',$id)

Then I've recieved and error:

Property "YiiLogController.menu" is not defined.

Change ./common/extensions/components/EController.php file. find:

public $breadcrumbs;

add below:

public $menu;