Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Generating migration WITHOUT oil
  • Hi! So basically title is the question. Is there any way to generate migration directly from controller for example, not from an oil? Or i'm just so stupid that a can't find that way
  • A migration is just a text file with PHP code, so you can create that from anywhere. But I assume you don't mean that. The migration files are generated by \Oil\Generate_Migration_Actions, you should be able to call the methods in it from a controller, provided you load the Oil package first. You still need the code to write the generated code to a file. Alternatively, call \Oil\Generate::migration(), and pass the correct arguments.
  • Thank you! It was a great idea to take \Oil\Generate::migration()... It took just to handle if statements where \Cli is called... i just made it something like if(\Fuel::$is_cli and \Cli::bla_bla_bla()) and it work just like it should be! Thank you one more time, you really made my .... basically, night already :D

Howdy, Stranger!

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

In this Discussion