codeigniter-scaffold 1.0.0 → 2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2ee92d8a5f85f81615f71c4e50653feef2a4af6f
4
+ data.tar.gz: def5ab4cfdbf1b83ebcaee1dc27acb8a3f6654a4
5
+ SHA512:
6
+ metadata.gz: 7c5f008352b75bebe6e794f6fb70619d3e5adcae1d5c60b0b1685524c63ef1c0b9d7a3289ead52548377f0bc7d0281e903aa03bddb33a514dd49aa036ec8a902
7
+ data.tar.gz: 3344b106a4cc04acca62dfacf7903c15e407dd7e33ab79e696f9049fdd0e704dacb1ba9f8a0eaf0cb57629b7ed5f0aded975f268c4c2aae4f9d057c6edc24938
@@ -1,6 +1,6 @@
1
- = codeigniter-scaffold
1
+ = codeigniter-scaffold {<img src="https://travis-ci.org/zekitow/codeigniter-scaffold.png" alt="Build Status" />}[https://travis-ci.org/zekitow/codeigniter-scaffold]
2
2
 
3
- Simple scaffold generator for codeigniter 2.1.
3
+ Simple scaffold generator for codeigniter 2.1.
4
4
 
5
5
  == Usage
6
6
 
@@ -18,6 +18,10 @@ Simple scaffold generator for codeigniter 2.1.
18
18
  * Go to 'application/migrations' and run the generated script into your database;
19
19
  3. Have fun =)
20
20
 
21
+ == Video Tutorial
22
+
23
+ Check out the video that show how to use codeigniter-scaffold at {youtube.com}[https://www.youtube.com/watch?v=2Djlz7nP1ks].
24
+
21
25
  == Contributing to codeigniter-scaffold
22
26
 
23
27
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
File without changes
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "codeigniter-scaffold"
8
- s.version = "1.0.0"
8
+ s.version = "2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["jribeiro"]
12
- s.date = "2012-12-05"
13
- s.description = "Simple codeigniter scaffolder"
11
+ s.authors = ["zekitow"]
12
+ s.date = "2012-08-13"
13
+ s.description = "Simple codeigniter scaffolder (crud creator)."
14
14
  s.email = "zekitow@gmail.com"
15
15
  s.executables = ["codeigniter-scaffold"]
16
16
  s.extra_rdoc_files = [
Binary file
@@ -7,27 +7,28 @@ class <%=@model.capitalize%> extends CI_Controller {
7
7
 
8
8
  function __construct() {
9
9
  parent::__construct();
10
- $this->load->helper(array('form','file','url'));
11
- $this->load->library('form_validation');
12
10
  $this->load->model('<%=@model.downcase%>_model');
13
11
  }
14
12
 
15
13
  # GET /<%=@model.downcase%>
16
14
  function index() {
17
15
  $data['<%=@model.downcase%>'] = $this-><%=@model.downcase%>_model->find();
18
- $this->load->view('/<%=@model.downcase%>/index', $data);
16
+ $data['content'] = '/<%=@model.downcase%>/index';
17
+ $this->load->view('/includes/template', $data);
19
18
  }
20
19
 
21
20
  # GET /<%=@model.downcase%>/create
22
21
  function create() {
23
- $this->load->view('/<%=@model.downcase%>/create');
22
+ $data['content'] = '/<%=@model.downcase%>/create';
23
+ $this->load->view('/includes/template', $data);
24
24
  }
25
25
 
26
26
  # GET /<%=@model.downcase%>/edit/1
27
27
  function edit() {
28
28
  $id = $this->uri->segment(3);
29
29
  $data['<%=@model.downcase%>'] = $this-><%=@model.downcase%>_model->find($id);
30
- $this->load->view('/<%=@model.downcase%>/create', $data);
30
+ $data['content'] = '/<%=@model.downcase%>/create';
31
+ $this->load->view('/includes/template', $data);
31
32
  }
32
33
 
33
34
  # GET /<%=@model.downcase%>/destroy/1
@@ -51,7 +52,8 @@ class <%=@model.capitalize%> extends CI_Controller {
51
52
  redirect('/<%=@model.downcase%>/index', 'refresh');
52
53
  }
53
54
  $data['<%=@model.downcase%>'] = $this->rebuild();
54
- $this->load->view('/<%=@model.downcase%>/create',$data);
55
+ $data['content'] = '/<%=@model.downcase%>/create';
56
+ $this->load->view('/includes/template', $data);
55
57
  }
56
58
 
57
59
  function rebuild() {
@@ -1,16 +1,15 @@
1
1
  <h1>Create</h1>
2
- <?php echo form_open('<%=@model.downcase%>/save'); ?>
3
- <div class="error"><?php echo validation_errors(); ?></div>
4
- <input type="hidden" name="id" value="<?php echo isset($<%=@model.downcase%>)?$<%=@model.downcase%>->id:''?>"/>
2
+ <?= form_open('<%=@model.downcase%>/save','role="form"'); ?><?php if(validation_errors() != NULL && validation_errors() != '') { ?>
3
+ <div class="alert alert-danger"><?= validation_errors(); ?></div><?php } ?>
4
+ <input type="hidden" name="id" value="<?= isset($<%=@model.downcase%>)?$<%=@model.downcase%>->id:''?>"/>
5
5
  <% @attributes.each { |f| %>
6
- <p>
7
- <label for="<%= f.name %>"><%= f.name %>:</label><br/><% if f.type == 'string' or f.type == 'integer' %>
8
- <input type="text" name="<%= f.name %>" value="<?php echo isset($<%=@model.downcase%>)?$<%=@model.downcase%>-><%= f.name %>:''?>"/><% end %>
6
+ <div class="form-group">
7
+ <label for="<%= f.name %>"><%= f.name.capitalize %>:</label><br/><% if f.type == 'string' or f.type == 'integer' %>
8
+ <input type="text" class="form-control" name="<%= f.name %>" placeholder="Enter <%= f.name.capitalize %>" value="<?= isset($<%=@model.downcase%>)?$<%=@model.downcase%>-><%= f.name %>:''?>"/><% end %>
9
9
  <% if f.type == 'text' %>
10
- <textarea name="<%= f.name %>"><?php echo isset($<%=@model.downcase%>)?$<%=@model.downcase%>-><%= f.name %>:''?></textarea><% end %>
11
-
12
- </p>
13
- <% } %>
14
- <input type="submit" value="Create"/>
10
+ <textarea name="<%= f.name %>" class="form-control"><?= isset($<%=@model.downcase%>)?$<%=@model.downcase%>-><%= f.name %>:''?></textarea><% end %>
11
+ </div><% } %>
12
+ <input type="submit" value="Save" class="btn btn-primary"/>
13
+ <?= anchor('<%=@model.downcase%>/index','Back','class="btn btn-link"'); ?>
15
14
  </form>
16
15
 
@@ -1,20 +1,17 @@
1
- <h1><%=@model.capitalize%></h1>
2
- <table>
1
+ <h2><%=@model.capitalize%></h2>
2
+ <table class="table">
3
3
  <tr>
4
- <th>Id</th>
5
- <% @attributes.each { | f | %>
6
- <th><%= f.name %></th><% } %>
4
+ <th>#</th><% @attributes.each { | f | %>
5
+ <th><%= f.name.capitalize %></th><% } %>
6
+ <th colspan="2"></th>
7
7
  </tr>
8
- <?php foreach ($<%=@model.downcase%> as $object) { ?>
9
- <tr>
10
- <td><?php echo $object->id ?></td>
11
- <% @attributes.each { | f | %>
12
- <td><?php echo $object-><%= f.name %> ?></td><% } %>
13
- <td><?php echo anchor('/<%=@model.downcase%>/edit/'.$object->id, 'Edit'); ?></td>
14
- <td><?php echo anchor('/<%=@model.downcase%>/destroy/'.$object->id, 'Destroy'); ?></td>
15
-
16
- </tr>
17
- <?php } ?>
8
+ <?php foreach ($<%=@model.downcase%> as $object) { ?>
9
+ <tr>
10
+ <td><?=$object->id ?></td><% @attributes.each { | f | %>
11
+ <td><?= $object-><%= f.name %> ?></td><% } %>
12
+ <td width="80"><?= anchor('/<%=@model.downcase%>/edit/'.$object->id, 'Edit','class="btn btn-warning"'); ?></td>
13
+ <td width="80"><?= anchor('/<%=@model.downcase%>/destroy/'.$object->id, 'Destroy','class="btn btn-danger"'); ?></td>
14
+ </tr><?php } ?>
18
15
  </table>
19
16
 
20
- <?php echo anchor('/<%=@model.downcase%>/create','Create'); ?>
17
+ <?= anchor('/<%=@model.downcase%>/create','Create','class="btn btn-primary"'); ?>
metadata CHANGED
@@ -1,52 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeigniter-scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: '2.0'
6
5
  platform: ruby
7
6
  authors:
8
- - jribeiro
7
+ - zekitow
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-05 00:00:00.000000000 Z
11
+ date: 2012-08-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rubyzip
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: linecache19
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: ruby-debug-base19x
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,39 +55,34 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: ruby-debug19
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: shoulda
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rdoc
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: bundler
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ~>
116
102
  - !ruby/object:Gem::Version
@@ -118,7 +104,6 @@ dependencies:
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ~>
124
109
  - !ruby/object:Gem::Version
@@ -126,7 +111,6 @@ dependencies:
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: jeweler
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
115
  - - ~>
132
116
  - !ruby/object:Gem::Version
@@ -134,7 +118,6 @@ dependencies:
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
122
  - - ~>
140
123
  - !ruby/object:Gem::Version
@@ -142,36 +125,32 @@ dependencies:
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: simplecov
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
- - - ! '>='
129
+ - - '>='
148
130
  - !ruby/object:Gem::Version
149
131
  version: '0'
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
- - - ! '>='
136
+ - - '>='
156
137
  - !ruby/object:Gem::Version
157
138
  version: '0'
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: rspec
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
- - - ! '>='
143
+ - - '>='
164
144
  - !ruby/object:Gem::Version
165
145
  version: '0'
166
146
  type: :development
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
- - - ! '>='
150
+ - - '>='
172
151
  - !ruby/object:Gem::Version
173
152
  version: '0'
174
- description: Simple codeigniter scaffolder
153
+ description: Simple codeigniter scaffolder (crud creator).
175
154
  email: zekitow@gmail.com
176
155
  executables:
177
156
  - codeigniter-scaffold
@@ -205,25 +184,24 @@ files:
205
184
  homepage: http://github.com/zekitow/codeigniter-scaffold
206
185
  licenses:
207
186
  - MIT
187
+ metadata: {}
208
188
  post_install_message:
209
189
  rdoc_options: []
210
190
  require_paths:
211
191
  - lib
212
192
  required_ruby_version: !ruby/object:Gem::Requirement
213
- none: false
214
193
  requirements:
215
- - - ! '>='
194
+ - - '>='
216
195
  - !ruby/object:Gem::Version
217
196
  version: '0'
218
197
  required_rubygems_version: !ruby/object:Gem::Requirement
219
- none: false
220
198
  requirements:
221
- - - ! '>='
199
+ - - '>='
222
200
  - !ruby/object:Gem::Version
223
201
  version: '0'
224
202
  requirements: []
225
203
  rubyforge_project:
226
- rubygems_version: 1.8.24
204
+ rubygems_version: 2.0.14
227
205
  signing_key:
228
206
  specification_version: 3
229
207
  summary: Simple gem for generate scaffolds for codeigniter