Cake Bake – Cake Console

Some quick tip to use cake bake
In normal, you will type : 

$cake bake

After that, you will answer each question of cake bake as what do you generate (D/M/V/C/P/Q …) … how to gen.
We have a quickly statement to do that : 

  1. Want to direct generate models
    $cake bake model
    
  2. Want to direct generate controller
    $cake bake controller
    
  3. Want to direct generate view
    $cake bake view
    
  4. Want to direct generate models with name
    $cake bake model model_name
    
  5. Want to direct generate controller with name
    $cake bake controller controller_name
    
  6. Want to direct generate view with view name
    $cake bake view controller_name view_name
    
  7. Want to direct generate view with template name
    view name and template name in : /cake/console/libs/templates/views and can add or override in : /app/vendors/shells/templates/views
     $cake bake view controller_name template_name view_name
    
  8. Want to generate controller like result of scaffold
    $cake bake controller Users scaffold
    
  9. Want to generate controller add more actions for admin
    $cake bake controller Users scaffold admin
    
  10. Want to gen controller only have actions for admin
    $cake bake controller Users null admin
    
  11. Gen help
    $cake bake model help
    
  12. List of model
    $cake bake all
    
  13. model -> controller -> views
    $cake bake all Model_name

Leave a Reply

Your email address will not be published. Required fields are marked *