Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation into Brazilian Portuguese and corrections to the documeation in English. #259

Merged
merged 7 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The package provides a `Yiisoft\View\View` class with basic functionality for managing views, and
a `Yiisoft\View\WebView` class with advanced functionality for use in a web environment. This guide applies to both
classes, but examples will be provided using the `Yiisoft\View\View`. For advanced examples with
`Yiisoft\View\WebView` functionality, see the "[Use in the web environment](use-in-web-environment.md)" guide.
`Yiisoft\View\WebView` functionality, see the [Use in the web environment](use-in-web-environment.md) guide.
luizcmarin marked this conversation as resolved.
Show resolved Hide resolved

To create a `Yiisoft\View\View` class, you must specify two mandatory parameters:

Expand Down Expand Up @@ -166,10 +166,6 @@ $view->setTheme($theme);
In a view, you can access the theme using the `getTheme()` method and manage assets as follows:

```php
<?php

luizcmarin marked this conversation as resolved.
Show resolved Hide resolved
declare(strict_types=1);

/** @var \Yiisoft\View\View $this */

$theme = $this->getTheme();
Expand Down Expand Up @@ -446,7 +442,6 @@ Content to be cached ...
Content to be cached ...
```


For caching content fragments, it's much more convenient to use dynamic content using the
`Yiisoft\Yii\Widgets\FragmentCache` widget from the
[yiisoft/yii-widgets](https://github.com/yiisoft/yii-widgets) package:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Use in the web environment

This guide describes extra functionality of the `Yiisoft\View\WebView` class intended for use in a web environment.
Please read the "[Basic Functionality](basic-functionality.md)" guide first.
Please read the [Basic Functionality](basic-functionality.md) guide first.
luizcmarin marked this conversation as resolved.
Show resolved Hide resolved

To create `Yiisoft\View\WebView` class, you must specify two mandatory parameters:

Expand Down Expand Up @@ -58,7 +58,7 @@ use Yiisoft\Html\Html;
To have scripts and tags registered and rendered correctly, special methods are called in the example above:

- `beginPage()` - This method should be called at the very beginning of the view template.
- `beginPage()` - This method should be called at the very end of the view template.
- `endPage()` - This method should be called at the very end of the view template.
- `head()` - This method should be called within the `<head>` section of an HTML page. It generates a placeholder which
will be replaced with the registered head HTML code (e.g. link tags, meta tags) when a page finishes rendering.
- `beginBody()` - This method should be called at the beginning of the `<body>` section. It generates a placeholder
Expand All @@ -69,11 +69,11 @@ To have scripts and tags registered and rendered correctly, special methods are
When registering [CSS](#registering-css), [JavaScript](#registering-javascript) and [link tags](#registering-link-tags),
you must specify the position in which this tag will be rendered. Positions are implemented by public constants:

- `POSITION_HEAD` - Corresponds to the `head()` method.
- `POSITION_BEGIN` - Corresponds to the `beginBody()` method.
- `POSITION_END` - Corresponds to the `endBody()` method.
- `POSITION_READY` - Corresponds to the `endBody()` method. Located after `POSITION_END`.
- `POSITION_LOAD` - Corresponds to the `endBody()` method. Located after `POSITION_READY`.
- `POSITION_HEAD` - In the head section. Corresponds to the `head()` method.
- `POSITION_BEGIN` - At the beginning of the body section. Corresponds to the `beginBody()` method.
- `POSITION_END` - At the end of the body section. Corresponds to the `endBody()` method. Located after `POSITION_READY`.
- `POSITION_READY` - Executed when HTML document composition is ready. Located after `POSITION_END`.
- `POSITION_LOAD` - Executed when HTML page is completely loaded.
luizcmarin marked this conversation as resolved.
Show resolved Hide resolved

Every Web page should have a title. You can set the title in this way:

Expand Down
Loading
Loading