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
80d3afa0
Commit
80d3afa0
authored
Feb 26, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gii extension generator adjustments
parent
692821e7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
23 deletions
+22
-23
Generator.php
extensions/gii/generators/crud/Generator.php
+1
-0
Generator.php
extensions/gii/generators/extension/Generator.php
+19
-21
AutoloadExample.php
...ns/gii/generators/extension/templates/AutoloadExample.php
+1
-1
README.md
extensions/gii/generators/extension/templates/README.md
+1
-1
No files found.
extensions/gii/generators/crud/Generator.php
View file @
80d3afa0
...
...
@@ -16,6 +16,7 @@ use yii\helpers\Inflector;
use
yii\web\Controller
;
/**
* Generates CRUD
*
* @property array $columnNames Model column names. This property is read-only.
* @property string $controllerID The controller ID (without the module ID prefix). This property is
...
...
extensions/gii/generators/extension/Generator.php
View file @
80d3afa0
<?php
/**
* @link
http://www.yiiframework.com/
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license
http://www.yiiframework.com/license/
* @license http://www.yiiframework.com/license/
*/
namespace
yii\gii\generators\extension
;
use
yii\gii\CodeFile
;
use
yii\helpers\Html
;
use
Yii
;
use
yii\
helpers\StringHelper
;
use
yii\
gii\CodeFile
;
/**
* This generator will generate the skeleton files needed by an extension.
*
* @author Tobias Munk <schmunk@usrbin.de>
* @since
2.0
* @since 2.0
*/
class
Generator
extends
\yii\gii\Generator
{
...
...
@@ -132,12 +130,12 @@ class Generator extends \yii\gii\Generator
public
function
successMessage
()
{
$outputPath
=
realpath
(
\Yii
::
getAlias
(
$this
->
outputPath
));
$output1
=
<<<EOD
$output1
=
<<<EOD
<p><em>The extension has been generated successfully.</em></p>
<p>To enable it in your application, you need to create a git repository
and require it via composer.</p>
EOD;
$code1
=
<<<EOD
$code1
=
<<<EOD
cd {$outputPath}/{$this->packageName}
git init
...
...
@@ -146,11 +144,11 @@ git commit
git remote add origin https://path.to/your/repo
git push -u origin master
EOD;
$output2
=
<<<EOD
$output2
=
<<<EOD
<p>The next step is just for <em>initial development</em>, skip it if you directly publish the extension on packagist.org</p>
<p>Add the newly created repo to your composer.json.</p>
EOD;
$code2
=
<<<EOD
$code2
=
<<<EOD
"repositories":[
{
"type": "git",
...
...
@@ -158,24 +156,24 @@ EOD;
}
]
EOD;
$output3
=
<<<EOD
$output3
=
<<<EOD
<p class="well">Note: You may use the url <code>file://{$outputPath}/{$this->packageName}</code> for testing.</p>
<p>Require the package with composer</p>
EOD;
$code3
=
<<<EOD
$code3
=
<<<EOD
composer.phar require {$this->vendorName}/{$this->packageName}:dev-master
EOD;
$output4
=
<<<EOD
$output4
=
<<<EOD
<p>And use it in your application.</p>
EOD;
$code4
=
<<<EOD
$code4
=
<<<EOD
\\{$this->namespace}AutoloadExample::widget();
EOD;
$output5
=
<<<EOD
$output5
=
<<<EOD
<p>When you have finished development register your extension at <a href='https://packagist.org/' target='_blank'>packagist.org</a>.</p>
EOD;
$return
=
$output1
.
'<pre>'
.
highlight_string
(
$code1
,
true
)
.
'</pre>'
;
$return
=
$output1
.
'<pre>'
.
highlight_string
(
$code1
,
true
)
.
'</pre>'
;
$return
.=
$output2
.
'<pre>'
.
highlight_string
(
$code2
,
true
)
.
'</pre>'
;
$return
.=
$output3
.
'<pre>'
.
highlight_string
(
$code3
,
true
)
.
'</pre>'
;
$return
.=
$output4
.
'<pre>'
.
highlight_string
(
$code4
,
true
)
.
'</pre>'
;
...
...
@@ -196,17 +194,17 @@ EOD;
*/
public
function
generate
()
{
$files
=
[];
$files
=
[];
$modulePath
=
$this
->
getOutputPath
();
$files
[]
=
new
CodeFile
(
$files
[]
=
new
CodeFile
(
$modulePath
.
'/'
.
$this
->
packageName
.
'/composer.json'
,
$this
->
render
(
"composer.json"
)
);
$files
[]
=
new
CodeFile
(
$files
[]
=
new
CodeFile
(
$modulePath
.
'/'
.
$this
->
packageName
.
'/AutoloadExample.php'
,
$this
->
render
(
"AutoloadExample.php"
)
);
$files
[]
=
new
CodeFile
(
$files
[]
=
new
CodeFile
(
$modulePath
.
'/'
.
$this
->
packageName
.
'/README.md'
,
$this
->
render
(
"README.md"
)
);
...
...
@@ -222,7 +220,7 @@ EOD;
}
/**
* @return a json encoded array with the given keywords
* @return
string
a json encoded array with the given keywords
*/
public
function
getKeywordsArrayJson
()
{
...
...
extensions/gii/generators/extension/templates/AutoloadExample.php
View file @
80d3afa0
<?php
/**
* This is just an example.
*
* This is just an example.
*/
echo
"<?php
\n
"
;
?>
...
...
extensions/gii/generators/extension/templates/README.md
View file @
80d3afa0
<
?=
$
generator-
>
title ?>
===
<
?=
str_repeat
('=',
mb_strlen
($
generator-
>
title,
\Y
ii::$app->charset)) ?>
<
?=
$
generator-
>
description ?>
...
...
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