Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Gii generator is broken #23

@antonkomarev

Description

@antonkomarev

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions