Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How to extend Oil using own templates like Generate_Admin?
  • Hi,

    I would like to extend Oil like it was done with "Generate_Admin" in the fuel-administrator from webstone.

    Have my own templates for controller, model and views and have them the oil package in the views folder under "perfectum" folder.

    I wrote an perfectum.php stored under oil/classes/generate:

    Extended the Oil Bootstrap with:
    'Oil\\Generate_Perfectum'            => __DIR__.'/classes/generate/perfectum.php',

    When I now use oil with "php oil g perfectum test name:string" nothing happenz.
    Any idea, why?

    The generate should create a controller under \app\classes\controller\admin
    so that I can use it in the admin section with http://fueladmin.local/admin/test ...

  • The Oil command class calls the Generate classes hardcoded, so you'll have to modify Command as well.

    It's one of the issues that needs to be fixed for 2.0. Code generation should not be in the Oil classes, it should be done through a view/viewmodel combination. So you can easily add your own generators.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion