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
e82881ba
Commit
e82881ba
authored
May 24, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master'
Conflicts: apps/advanced/composer.json
parents
0fb30f8d
93df0731
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
65 additions
and
51 deletions
+65
-51
composer.json
apps/advanced/composer.json
+3
-3
README.md
apps/basic/README.md
+1
-1
.gitkeep
apps/basic/assets/.gitkeep
+0
-0
console.php
apps/basic/config/console.php
+2
-2
main.php
apps/basic/config/main.php
+2
-2
.gitignore
apps/basic/runtime/.gitignore
+2
-0
.gitignore
apps/basic/vendor/.gitignore
+2
-0
.gitignore
apps/basic/www/assets/.gitignore
+2
-0
bootstrap.md
docs/guide/bootstrap.md
+48
-41
Menu.php
framework/yii/widgets/Menu.php
+3
-2
No files found.
apps/advanced/composer.json
View file @
e82881ba
{
"name"
:
"yiisoft/yii2-app-
basic
"
,
"description"
:
"Yii 2
Basic
Application Template"
,
"keywords"
:
[
"yii"
,
"framework"
,
"
basic
"
,
"application template"
],
"name"
:
"yiisoft/yii2-app-
advanced
"
,
"description"
:
"Yii 2
Advanced
Application Template"
,
"keywords"
:
[
"yii"
,
"framework"
,
"
advanced
"
,
"application template"
],
"homepage"
:
"http://www.yiiframework.com/"
,
"type"
:
"project"
,
"license"
:
"BSD-3-Clause"
,
...
...
apps/basic/README.md
View file @
e82881ba
...
...
@@ -52,7 +52,7 @@ You can then install the Bootstrap Application using the following command:
php composer.phar create-project --stability=dev yiisoft/yii2-app-basic yii-basic
~~~
Now you should be able to access the
Bootstrap A
pplication using the URL
`http://localhost/yii-basic/www/`
,
Now you should be able to access the
a
pplication using the URL
`http://localhost/yii-basic/www/`
,
assuming
`yii-basic`
is directly under the document root of your Web server.
...
...
apps/basic/assets/.git
ignore
→
apps/basic/assets/.git
keep
View file @
e82881ba
File moved
apps/basic/config/console.php
View file @
e82881ba
<?php
$params
=
require
(
__DIR__
.
'/params.php'
);
return
array
(
'id'
=>
'bootstrap-console'
,
'basePath'
=>
dirname
(
__DIR__
),
...
...
@@ -22,5 +22,5 @@ return array(
),
),
),
'params'
=>
require
(
__DIR__
.
'/params.php'
)
,
'params'
=>
$params
,
);
apps/basic/config/main.php
View file @
e82881ba
<?php
$params
=
require
(
__DIR__
.
'/params.php'
);
return
array
(
'id'
=>
'bootstrap'
,
'basePath'
=>
dirname
(
__DIR__
),
...
...
@@ -34,5 +34,5 @@ return array(
),
),
),
'params'
=>
require
(
__DIR__
.
'/params.php'
)
,
'params'
=>
$params
,
);
apps/basic/runtime/.gitignore
View file @
e82881ba
*
!.gitignore
\ No newline at end of file
apps/basic/vendor/.gitignore
View file @
e82881ba
*
!.gitignore
\ No newline at end of file
apps/basic/www/assets/.gitignore
View file @
e82881ba
*
!.gitignore
\ No newline at end of file
docs/guide/bootstrap.md
View file @
e82881ba
Bootstrap with Yii
==================
A ready-to-use Web application is distributed together with Yii. You may find
its source code under the
`app`
folder after you expand the Yii release file.
If you have installed Yii under a Web-accessible folder, you should be able to
access this application through the following URL:
Yii provides a few read-to-use application templates. Based on your needs, you may
choose one of them to bootstrap your project.
In following, we describe how to get started with the "Yii 2 Basic Application Template".
### Install via Composer
If you do not have
[
Composer
](
http://getcomposer.org/
)
, you may download it from
[
http://getcomposer.org/
](
http://getcomposer.org/
)
or run the following command on Linux/Unix/MacOS:
~~~
http://localhost/yii/apps/bootstrap/index.
php
curl -s http://getcomposer.org/installer |
php
~~~
You can then install the Bootstrap Application using the following command:
~~~
php composer.phar create-project --stability=dev yiisoft/yii2-app-basic yii-basic
~~~
Now you should be able to access the Bootstrap Application using the URL
`http://localhost/yii-basic/www/`
,
assuming
`yii-basic`
is directly under the document root of your Web server.
As you can see, the application has four pages: the homepage, the about page,
the contact page and the login page. The contact page displays a contact
...
...
@@ -20,42 +35,34 @@ and the login page allows users to be authenticated before accessing privileged
The following diagram shows the directory structure of this application.
~~~
app/
index.php Web application entry script file
index-test.php entry script file for the functional tests
assets/ containing published resource files
css/ containing CSS files
img/ containing image files
themes/ containing application themes
protected/ containing protected application files
yii yii command line script for Unix/Linux
yii.bat yii command line script for Windows
commands/ containing customized yii console commands
components/ containing reusable user components
config/ containing configuration files
console.php the console application configuration
main.php the Web application configuration
controllers/ containing controller class files
SiteController.php the default controller class
data/ containing the sample database
schema.mysql.sql the DB schema for the sample MySQL database
schema.sqlite.sql the DB schema for the sample SQLite database
bootstrap.db the sample SQLite database file
vendor/ containing third-party extensions and libraries
messages/ containing translated messages
models/ containing model class files
User.php the User model
LoginForm.php the form model for 'login' action
ContactForm.php the form model for 'contact' action
runtime/ containing temporarily generated files
views/ containing controller view and layout files
layouts/ containing layout view files
main.php the base layout shared by all pages
site/ containing view files for the 'site' controller
about.php the view for the 'about' action
contact.php the view for the 'contact' action
index.php the view for the 'index' action
login.php the view for the 'login' action
yii-basic/
yii yii command line script for Unix/Linux
yii.bat yii command line script for Windows
requirements.php the requirement checker script
commands/ containing customized yii console commands
config/ containing configuration files
console.php the console application configuration
main.php the Web application configuration
controllers/ containing controller class files
SiteController.php the default controller class
vendor/ containing third-party extensions and libraries
models/ containing model class files
User.php the User model
LoginForm.php the form model for 'login' action
ContactForm.php the form model for 'contact' action
runtime/ containing temporarily generated files
views/ containing controller view and layout files
layouts/ containing layout view files
main.php the base layout shared by all pages
site/ containing view files for the 'site' controller
about.php the view for the 'about' action
contact.php the view for the 'contact' action
index.php the view for the 'index' action
login.php the view for the 'login' action
www/ containing Web-accessible resources
index.php Web application entry script file
assets/ containing published resource files
css/ containing CSS files
~~~
...
...
framework/yii/widgets/Menu.php
View file @
e82881ba
...
...
@@ -63,7 +63,8 @@ class Menu extends Widget
* - template: string, optional, the template used to render the content of this menu item.
* The token `{url}` will be replaced by the URL associated with this menu item,
* and the token `{label}` will be replaced by the label of the menu item.
* If this option is not set, [[linkTemplate]] or [[labelTemplate]] will be used instead.
* If this option is not set, [[linkTemplate]] or [[labelTemplate]] will be used instead.
* - options: array, optional, the HTML attributes for the menu container tag.
*/
public
$items
=
array
();
/**
...
...
@@ -163,7 +164,7 @@ class Menu extends Widget
$n
=
count
(
$items
);
$lines
=
array
();
foreach
(
$items
as
$i
=>
$item
)
{
$options
=
isset
(
$item
[
'
itemOptions'
])
?
$item
[
'itemO
ptions'
]
:
array
();
$options
=
isset
(
$item
[
'
options'
])
?
$item
[
'o
ptions'
]
:
array
();
$class
=
array
();
if
(
$item
[
'active'
])
{
$class
[]
=
$this
->
activeCssClass
;
...
...
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