Skip to content

Instantly share code, notes, and snippets.

@hardfire
Created September 1, 2012 16:59
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hardfire/3580385 to your computer and use it in GitHub Desktop.
create base files for a bonfire module
#! /bin/bash
# create base files for a bonfire module
u=$(tr '[a-z]' '[A-Z]' <<< ${1:0:1})
className="${u}${1:1}"
mkdir $1
mkdir "$1/assets"
mkdir "$1/config"
mkdir "$1/controllers"
mkdir "$1/migrations"
mkdir "$1/models"
mkdir "$1/views"
touch "$1/config/config.php"
cat << EOF >> "$1/controllers/$1.php"
<?php
class $className extends Front_Controller
{
public function __construct()
{
parent::__construct();
}
public function index()
{
}
}
EOF
cat << EOF >> "$1/controllers/content.php"
<?php
class Content extends Admin_Controller
{
public function __construct()
{
parent::__construct();
Template::set('toolbar_title', '$1');
}
public function index()
{
}
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment