Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
f87e4ce6
Commit
f87e4ce6
authored
Aug 31, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
automatically hide model class input if needed.
parent
c364e266
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
gii.js
framework/yii/gii/assets/gii.js
+5
-0
DefaultController.php
framework/yii/gii/controllers/DefaultController.php
+1
-1
view.php
framework/yii/gii/views/default/view.php
+4
-1
No files found.
framework/yii/gii/assets/gii.js
View file @
f87e4ce6
...
...
@@ -76,6 +76,11 @@ yii.gii = (function ($) {
initPreviewDiffLinks
();
initConfirmationCheckboxes
();
// model generator: hide class name input when table name input contains *
$
(
'#model-generator #generator-tablename'
).
on
(
'change'
,
function
()
{
$
(
'#model-generator .field-generator-modelclass'
).
toggle
(
$
(
this
).
val
().
indexOf
(
'*'
)
==
-
1
);
}).
change
();
// hide Generate button if any input is changed
$
(
'.default-view .form-group input,select,textarea'
).
change
(
function
()
{
$
(
'.default-view-results,.default-view-files'
).
hide
();
...
...
framework/yii/gii/controllers/DefaultController.php
View file @
f87e4ce6
...
...
@@ -35,7 +35,7 @@ class DefaultController extends Controller
public
function
actionView
(
$id
)
{
$generator
=
$this
->
loadGenerator
(
$id
);
$params
=
array
(
'generator'
=>
$generator
);
$params
=
array
(
'generator'
=>
$generator
,
'id'
=>
$id
);
if
(
isset
(
$_POST
[
'preview'
])
||
isset
(
$_POST
[
'generate'
]))
{
if
(
$generator
->
validate
())
{
$generator
->
saveStickyAttributes
();
...
...
framework/yii/gii/views/default/view.php
View file @
f87e4ce6
...
...
@@ -28,7 +28,10 @@ foreach ($generator->templates as $name => $path) {
<p>
<?php
echo
$generator
->
getDescription
();
?>
</p>
<?php
$form
=
ActiveForm
::
begin
(
array
(
'fieldConfig'
=>
array
(
'class'
=>
ActiveField
::
className
())));
?>
<?php
$form
=
ActiveForm
::
begin
(
array
(
'id'
=>
"
$id
-generator"
,
'fieldConfig'
=>
array
(
'class'
=>
ActiveField
::
className
()),
));
?>
<div
class=
"row"
>
<div
class=
"col-lg-8"
>
<?php
echo
$this
->
renderFile
(
$generator
->
formView
(),
array
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment