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
22e4684a
Commit
22e4684a
authored
Aug 19, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #784 from lucianobaraglia/master
Last typo fixes in guide - I swear - [skip ci]
parents
5c4ad45f
4c805821
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
18 deletions
+15
-18
configuration.md
docs/guide/configuration.md
+3
-4
controller.md
docs/guide/controller.md
+2
-3
overview.md
docs/guide/overview.md
+1
-2
performance.md
docs/guide/performance.md
+2
-2
query-builder.md
docs/guide/query-builder.md
+1
-1
security.md
docs/guide/security.md
+1
-1
view.md
docs/guide/view.md
+5
-5
No files found.
docs/guide/configuration.md
View file @
22e4684a
...
@@ -4,7 +4,7 @@ Configuration
...
@@ -4,7 +4,7 @@ Configuration
In Yii application and majority of components have sensible defaults so it's unlikely you spend lots of time configuring
In Yii application and majority of components have sensible defaults so it's unlikely you spend lots of time configuring
it. Still there are some mandatory options such as database connection you should set up.
it. Still there are some mandatory options such as database connection you should set up.
How application is configured depends on application template but there are some genral principles applying in any case.
How application is configured depends on application template but there are some gen
e
ral principles applying in any case.
Configuring options in bootstrap file
Configuring options in bootstrap file
-------------------------------------
-------------------------------------
...
@@ -39,7 +39,7 @@ return array(
...
@@ -39,7 +39,7 @@ return array(
);
);
```
```
In the above array keys are names of application properties. Depending on application type you can check properies of
In the above array keys are names of application properties. Depending on application type you can check proper
t
ies of
either
`\yii\web\Application`
or
`\yii\console\Application`
. Both are extended from
`\yii\base\Application`
.
either
`\yii\web\Application`
or
`\yii\console\Application`
. Both are extended from
`\yii\base\Application`
.
> Note that you can configure not only public class properties but anything accessible via setter. For example, to
> Note that you can configure not only public class properties but anything accessible via setter. For example, to
...
@@ -95,4 +95,4 @@ not be instantiated and configured at all.
...
@@ -95,4 +95,4 @@ not be instantiated and configured at all.
Setting component defaults classwide
Setting component defaults classwide
------------------------------------
------------------------------------
TBD
TBD
\ No newline at end of file
docs/guide/controller.md
View file @
22e4684a
...
@@ -59,7 +59,7 @@ If user isn't specifying any route i.e. using URL like `http://example.com/`, Yi
...
@@ -59,7 +59,7 @@ If user isn't specifying any route i.e. using URL like `http://example.com/`, Yi
used. It is determined by
[
[\yii\web\Application::defaultRoute
]
] method and is
`site`
by default meaning that
`SiteController`
used. It is determined by
[
[\yii\web\Application::defaultRoute
]
] method and is
`site`
by default meaning that
`SiteController`
will be loaded.
will be loaded.
A controller has a default action. When the user request does not specify which action to execute by usi
gn
an URL such as
A controller has a default action. When the user request does not specify which action to execute by usi
ng
an URL such as
`http://example.com/?r=site`
, the default action will be executed. By default, the default action is named as
`index`
.
`http://example.com/?r=site`
, the default action will be executed. By default, the default action is named as
`index`
.
It can be changed by setting the
[
[\yii\base\Controller::defaultAction
]
] property.
It can be changed by setting the
[
[\yii\base\Controller::defaultAction
]
] property.
...
@@ -187,4 +187,4 @@ Catching all incoming requests
...
@@ -187,4 +187,4 @@ Catching all incoming requests
See also
See also
--------
--------
-
[
Console
](
console.md
)
-
[
Console
](
console.md
)
\ No newline at end of file
docs/guide/overview.md
View file @
22e4684a
...
@@ -37,4 +37,4 @@ How does Yii Compare with Other Frameworks?
...
@@ -37,4 +37,4 @@ How does Yii Compare with Other Frameworks?
-
Syntax and overall development usability are taken seriously.
-
Syntax and overall development usability are taken seriously.
-
Performance is one of the key goals.
-
Performance is one of the key goals.
-
We are constantly watching other web frameworks out there and getting the best ideas in. Initial Yii release was heavily
-
We are constantly watching other web frameworks out there and getting the best ideas in. Initial Yii release was heavily
influenced by Ruby on Rails. Still, we aren't blindly copying anyhting.
influenced by Ruby on Rails. Still, we aren't blindly copying anything.
\ No newline at end of file
docs/guide/performance.md
View file @
22e4684a
...
@@ -116,7 +116,7 @@ If a whole page remains relative static, we can use the page caching approach to
...
@@ -116,7 +116,7 @@ If a whole page remains relative static, we can use the page caching approach to
save the rendering cost for the whole page.
save the rendering cost for the whole page.
### Leveraging HTTP to save procesing time and bandwidth
### Leveraging HTTP to save proces
s
ing time and bandwidth
TBD
TBD
...
@@ -134,7 +134,7 @@ but it may slow down INSERT, UPDATE or DELETE queries.
...
@@ -134,7 +134,7 @@ but it may slow down INSERT, UPDATE or DELETE queries.
For complex queries, it is recommended to create a database view for it instead
For complex queries, it is recommended to create a database view for it instead
of issuing the queries inside the PHP code and asking DBMS to parse them repetitively.
of issuing the queries inside the PHP code and asking DBMS to parse them repetitively.
Do not overuse Active Record. Although Active Record is good at model
l
ing data
Do not overuse Active Record. Although Active Record is good at modeling data
in an OOP fashion, it actually degrades performance due to the fact that it needs
in an OOP fashion, it actually degrades performance due to the fact that it needs
to create one or several objects to represent each row of query result. For data
to create one or several objects to represent each row of query result. For data
intensive applications, using DAO or database APIs at lower level could be
intensive applications, using DAO or database APIs at lower level could be
...
...
docs/guide/query-builder.md
View file @
22e4684a
...
@@ -169,7 +169,7 @@ WHERE (`status` = 10) AND (`title` LIKE '%yii%')
...
@@ -169,7 +169,7 @@ WHERE (`status` = 10) AND (`title` LIKE '%yii%')
Order
Order
-----
-----
For odering results
`orderBy`
and
`addOrderBy`
could be used:
For o
r
dering results
`orderBy`
and
`addOrderBy`
could be used:
```
php
```
php
$query
->
orderBy
(
array
(
$query
->
orderBy
(
array
(
...
...
docs/guide/security.md
View file @
22e4684a
Security
Security
========
========
Hashing and verifyig passwords
Hashing and verifyi
n
g passwords
------------------------------
------------------------------
It is important not to store passwords in plain text but, contrary to popular belief, just using
`md5`
or
`sha1`
to
It is important not to store passwords in plain text but, contrary to popular belief, just using
`md5`
or
`sha1`
to
...
...
docs/guide/view.md
View file @
22e4684a
View
View
====
====
View is an important part of MVC and is reponsible for how data is presented to the end user.
View is an important part of MVC and is re
s
ponsible for how data is presented to the end user.
Basics
Basics
------
------
...
@@ -32,7 +32,7 @@ So the view for the action above should be in `views/site/index.php` and can be
...
@@ -32,7 +32,7 @@ So the view for the action above should be in `views/site/index.php` and can be
<p>
Hello,
<?php
echo
$username
?>
!
</p>
<p>
Hello,
<?php
echo
$username
?>
!
</p>
```
```
Intead of just scalar values you can pass anything else such as arrays or objects.
In
s
tead of just scalar values you can pass anything else such as arrays or objects.
Widgets
Widgets
-------
-------
...
@@ -108,7 +108,7 @@ Note that besides HTMLPurifier does excellent job making output safe it's not ve
...
@@ -108,7 +108,7 @@ Note that besides HTMLPurifier does excellent job making output safe it's not ve
Alternative template languages
Alternative template languages
------------------------------
------------------------------
There are off
l
icial extensions for
[
Smarty
](
http://www.smarty.net/
)
and
[
Twig
](
http://twig.sensiolabs.org/
)
. In order
There are official extensions for
[
Smarty
](
http://www.smarty.net/
)
and
[
Twig
](
http://twig.sensiolabs.org/
)
. In order
to learn more refer to
[
Using template engines
](
template.md
)
section of the guide.
to learn more refer to
[
Using template engines
](
template.md
)
section of the guide.
Using View object in templates
Using View object in templates
...
@@ -128,7 +128,7 @@ $this->title = 'My page title';
...
@@ -128,7 +128,7 @@ $this->title = 'My page title';
### Adding meta tags
### Adding meta tags
Adding meta tags such as encodig, description, keywords is easy with view object as well:
Adding meta tags such as encodi
n
g, description, keywords is easy with view object as well:
```
php
```
php
$this
->
registerMetaTag
(
array
(
'encoding'
=>
'utf-8'
));
$this
->
registerMetaTag
(
array
(
'encoding'
=>
'utf-8'
));
...
@@ -156,7 +156,7 @@ override the former and only a single tag will be rendered:
...
@@ -156,7 +156,7 @@ override the former and only a single tag will be rendered:
### Registering link tags
### Registering link tags
`<link>`
tag is useful in many cases such as customizing favicon, ponting to RSS feed or delegating OpenID to another
`<link>`
tag is useful in many cases such as customizing favicon, po
i
nting to RSS feed or delegating OpenID to another
server. Yii view object has a method to work with these:
server. Yii view object has a method to work with these:
```
php
```
php
...
...
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