Формы в symfony 1.1

Fabien, “Формы в symfony 1.1”, public translation into Russian from English More about this translation.

See also 140 similar translations

Translate into another language.

Participants

tyutin660 points
skiff649 points
Fenrir470 points
And others...
Join Translated.by to translate! If you already have a Translated.by account, please sign in.
If you do not want to register an account, you can sign in with OpenID.
Pages: ← previous Ctrl next next untranslated
1 2 3 4 5 6 7 8 9 10

Формы в symfony 1.1

Формы в symfony 1.1

History of edits (Latest: testuser3 3 years, 6 months ago) §

A form is made of fields like hidden inputs, text inputs, select boxes, and checkboxes. This chapter introduces you to creating forms and managing form fields using the symfony forms framework.

Форма состоит из полей, таких, как скрытые поля, текстовые поля, выпадающие списки, чекбоксы. Эта глава познакомит вас с созданием форм и управлением полями с помощью фреймворка форм symfony.

History of edits (Latest: Fenrir 3 years, 4 months ago) §

Symfony 1.1 is required to follow the chapters of this book. You will also need to create a project and a frontend application to keep going. Please refer to the introduction for more information on symfony project creation.

Для выполнения упражнений из книги требуется Symfony 1.1. Кроме того, для дальнейшей работы вам нужно будет создать проект и приложение. Для более полной информации о создании проекта, читайте Введение.

History of edits (Latest: skiff 3 years, 6 months ago) §

Before we start

Прежде, чем мы начнём

History of edits (Latest: Fenrir 3 years, 4 months ago) §

We will begin by adding a contact form to a symfony application.

Начнём с добавления формы обратной связи к приложению.

History of edits (Latest: develop7 3 years, 7 months ago) §

Figure 1-1 shows the contact form as seen by users who want to send a message.

На рисунке 1-1 изображена форма обратной связи так, как её видит пользователь.

History of edits (Latest: develop7 3 years, 7 months ago) §

Figure 1-1 - Contact form

Рисунок 1-1 — Форма обратной связи

History of edits (Latest: Fenrir 3 years, 4 months ago) §

Contact form

Форма обратной связи

History of edits (Latest: develop7 3 years, 7 months ago) §

We will create three fields for this form: the name of the user, the email of the user, and the message the user wants to send. We will simply display the information submitted in the form for the purpose of this exercise as shown in Figure 1-2.

Создадим три поля: имя пользователя, его email и сообщение, которое он хочет отправить. Для выполнения упражнения мы просто отобразим информацию, переданную формой, как показано на рисунке 1-2.

History of edits (Latest: Fenrir 3 years, 4 months ago) §

Figure 1-2 - Thank you Page

Рисунок 1-2 - Страница благодарности

History of edits (Latest: tyutin 3 years, 6 months ago) §

Thank you page

Страница благодарности

History of edits (Latest: tyutin 3 years, 6 months ago) §

Figure 1-3 - Shows the interaction between the application and the user.

Рисунок 1-3 показывает процесс взаимодействия между приложением и пользователем.

History of edits (Latest: tyutin 3 years, 6 months ago) §

Figure 1-3 - Interaction with the User

Рисунок 1-3 — Взаимодействие с пользователем

History of edits (Latest: Fenrir 3 years, 4 months ago) §

Interaction with the user schema

Схема взаимодействия с пользователем

History of edits (Latest: d_evelop7 3 years, 7 months ago) §

Widgets

Виджеты

History of edits (Latest: d_evelop7 3 years, 7 months ago) §

sfForm and sfWidget Classes

Классы sfForm и sfWidget

History of edits (Latest: d_evelop7 3 years, 7 months ago) §

Users input information into fields which make up forms. In symfony, a form is an object inheriting from the sfForm class. In our example, we will create a ContactForm class inheriting from the sfForm class. sfForm is the base class of all forms. sfForm makes it easy to manage the configuration and the life cycle of your forms.

Пользователи вводят информацию в поля, составляющие форму. Форма в symfony — это объект, наследующий класс sfForm. В нашем примере мы создадим класс ContactForm, наследующий класс sfForm. sfForm — это базовый класс для всех форм. sfForm облегчает управление конфигурацией и жизненным циклом ваших форм.

History of edits (Latest: Fenrir 3 years, 4 months ago) §

sfForm is the base class of all forms and makes it easy to manage the configuration and life cycle of your forms.

sfForm — это базовый класс для всех форм, облегчающий управление конфигурацией и жизненным циклом ваших форм.

History of edits (Latest: Fenrir 3 years, 4 months ago) §

— Этот абзац повторяет два предложения предыдущего Enlightened

You can start configuring your form by adding widgets using the configure() method.

Настройку формы можно начать с добавления виджетов в методе configure().

History of edits (Latest: d_evelop7 3 years, 7 months ago) §

A widget represents a form field. For our form example, we need to add three widgets representing our three fields: name, email, and message. Listing 1-1 shows the first implementation of the ContactForm class.

Виджет представляет поле формы. Для формы нашего примера добавим три виджета, представляющих ее поля: имя, email и сообщение. На листинге 1-1 показана первая реализация класса ContactForm.

History of edits (Latest: Fenrir 3 years, 4 months ago) §

Listing 1-1 - ContactForm class with three fields

Листинг 1-1 — Класс ContactForm с тремя полями

History of edits (Latest: Fenrir 3 years, 4 months ago) §

// lib/form/ContactForm.class.php

// lib/form/ContactForm.class.php

History of edits (Latest: hooey 3 years, 6 months ago) §

class ContactForm extends sfForm

class ContactForm extends sfForm

History of edits (Latest: hooey 3 years, 6 months ago) §

{

{

History of edits (Latest: hooey 3 years, 6 months ago) §

public function configure()

public function configure()

History of edits (Latest: hooey 3 years, 6 months ago) §

{

{

History of edits (Latest: hooey 3 years, 6 months ago) §

$this->setWidgets(array(

$this->setWidgets(array(

History of edits (Latest: hooey 3 years, 6 months ago) §
Pages: ← previous Ctrl next next untranslated
1 2 3 4 5 6 7 8 9 10

© sensiolabs. License: GFDL license