Created
September 1, 2012 16:59
-
-
Save hardfire/3580385 to your computer and use it in GitHub Desktop.
create base files for a bonfire module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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