A template-driven, programming language independent CRUD generator
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
css
images
js
lib
templates
.gitignore
CrudDatabaseTableFieldTypes.inc
DatabaseTable.php
INSTALL
LICENSE
MainController.php
README-TEMPLATES
README-TEMPLATES-PLAY.md
README.md
TODO
app.cfg
db.cfg
footer.tpl
index.php
index.tpl
lib-NOTE
smarty.cfg
ws_gen_code.php
ws_get_table_names.php

README.md

Cato

Updates

As of January 10, 2013, Cato now supports the Play Framework v2.x.
As of March 31, 2014, Cato now supports Play Framework 2.x JSON code.

Introduction

Cato is a CRUD generator that can be used to generate files for any programming language or tool. For instance, you can generate any of these CRUD-based files, and many more:

  • The Play Framework
  • Drupal form files
  • Java model classes
  • Java JSP files
  • Spring Framework XML files
  • Ruby on Rails files
  • CakePHP files
  • SQL statements for any language
  • Anything else you can imagine that can be driven off your database tables

All you have to do is tell Cato where your database is, define some template files (as needed), then point and click to generate whatever file you want that can be based off your database definition.

This is essentially the same process used in the "generate" processes of Ruby on Rails and CakePHP, but it is (a) independent of programming language, and (b) available through a web GUI.

Using Cato

Once installed, using Cato is easy to use. From the main screen:

  1. Select the database table you'd like to generate CRUD from.
  2. Select the table fields you want to include.
  3. Select the template for the output you want to generate.
  4. Click the "Generate" button.

You can see a short demo in action at this URL:

http://www.catocrudgenerator.com/screenshots-crud-generator/

The INSTALL file describes the process of installing Cato, which I've also tried to make as painless as possible.

Template Files

As you saw in that demo, Cato generates its CRUD output based on template files. As a result, if you can define the template file for what you want, you can easily generate CRUD-based output.

Many template files are included as examples. You can use those, or just use them as examples to create your own template files.

The templating language is based on the Smarty template project. I've documented this in the README-TEMPLATES file, and you can learn much more about Smarty templates at this URL:

http://www.smarty.net/

More Information

You can find more information about the Cato Project at this URL:

http://www.catocrudgenerator.com

See the original Cato CRUD Generator video here:

http://www.youtube.com/watch?v=lNd7yU_Nfv8

See the "Rails-like Development for Drupal 7 Forms" video, featuring Cato, here:

http://www.youtube.com/watch?v=0cKzM9e26eM

See the "Play Framework 2 CRUD with Cato" video here:

http://alvinalexander.com/scala/crud-forms-play-framework-2-cato-crud-generator

The Name "Cato"

The name "Cato" comes from the character on the old Pink Panther movies. When I (Alvin Alexander) first started developing this project, I thought that this app should be an "assistant" to me when developing database applications. As soon as I thought of "assistant" I thought of Cato, Inspector Clouseau's trusty assistant.

alvinalexander.com

This project was created by Alvin Alexander of http://alvinalexander.com