Documentation

TermEditController extends VocabularyBaseController
in package

Controller for creating and editing single-word terms.

Handles:

  • /word/edit - Edit word form
  • /word/new - Create new word
  • /word/inline-edit - Inline edit translation/romanization
  • /word/edit-term - Edit term during review
  • /word/delete-term - Delete term (iframe view)
Tags
since
3.0.0

Table of Contents

Properties

$bulkService  : WordBulkService|null
$contextService  : WordContextService|null
$crudService  : WordCrudService|null
Lazy-loaded services.
$discoveryService  : WordDiscoveryService|null
$expressionService  : ExpressionService|null
$linkingService  : WordLinkingService|null
$multiWordService  : MultiWordService|null
$sentenceService  : SentenceService|null
$textStatisticsService  : TextStatisticsService|null
$uploadService  : WordUploadService|null
$viewPath  : string
View base path.
$dictionaryAdapter  : DictionaryAdapter
Adapters.
$facade  : VocabularyFacade
Vocabulary facade.
$languageFacade  : LanguageFacade
Services.

Methods

__construct()  : mixed
Constructor.
createWord()  : void
Create new word form.
deleteWord()  : RedirectResponse
Delete word.
editTerm()  : void
Edit term while reviewing: ?wid=[wordid].
editWord()  : void
Edit word form: ?wid=[wordid] or ?tid=[textid]&ord=[ord].
editWordById()  : void
Edit word by ID.
inlineEdit()  : void
Inline edit word.
setViewPath()  : void
Set custom view path.
getBulkService()  : WordBulkService
Get WordBulkService (lazy loaded).
getContextService()  : WordContextService
Get WordContextService (lazy loaded).
getCrudService()  : WordCrudService
Get WordCrudService (lazy loaded).
getDiscoveryService()  : WordDiscoveryService
Get WordDiscoveryService (lazy loaded).
getExpressionService()  : ExpressionService
Get ExpressionService (lazy loaded).
getLinkingService()  : WordLinkingService
Get WordLinkingService (lazy loaded).
getMultiWordService()  : MultiWordService
Get MultiWordService (lazy loaded).
getSentenceService()  : SentenceService
Get SentenceService (lazy loaded).
getTextStatisticsService()  : TextStatisticsService
Get TextStatisticsService (lazy loaded).
getUploadService()  : WordUploadService
Get WordUploadService (lazy loaded).
render()  : void
Render a view.
renderEditorPage()  : void
Render the standalone term editor.

Properties

Methods

createWord()

Create new word form.

public createWord(array<string, string> $params) : void

Handles:

  • Display form: ?lang=[langid]&text=[textid]
  • Save: ?op=Save
Parameters
$params : array<string, string>

Route parameters

editTerm()

Edit term while reviewing: ?wid=[wordid].

public editTerm(array<string, string> $params) : void
Parameters
$params : array<string, string>

Route parameters

editWord()

Edit word form: ?wid=[wordid] or ?tid=[textid]&ord=[ord].

public editWord(array<string, string> $params) : void
Parameters
$params : array<string, string>

Route parameters

editWordById()

Edit word by ID.

public editWordById(int $id) : void

Route: GET /words/{id}/edit

Parameters
$id : int

Word ID from route parameter

inlineEdit()

Inline edit word.

public inlineEdit(array<string, string> $params) : void

Handles AJAX inline editing of translation or romanization fields. POST parameters:

  • id: string - Field identifier (e.g., "trans123" or "roman123" where 123 is word ID)
  • value: string - New value for the field
Parameters
$params : array<string, string>

Route parameters

setViewPath()

Set custom view path.

public setViewPath(string $path) : void
Parameters
$path : string

View path

render()

Render a view.

protected render(string $view[, array<string|int, mixed> $data = [] ]) : void
Parameters
$view : string

View name (without .php)

$data : array<string|int, mixed> = []

View data

renderEditorPage()

Render the standalone term editor.

private renderEditorPage(int $textId, int $position, int|null $wordId, string $returnUrl) : void

The page carries only the identifiers; termEditPage loads the term from GET /api/v1/terms/for-edit and mounts the same editor the reading view opens in a modal, so there is one editor rather than three forms.

Parameters
$textId : int

Text ID, or 0 when editing an existing term

$position : int

Word position in the text, or 0

$wordId : int|null

Term ID, or null when creating from a position

$returnUrl : string

Where to go once editing finishes

On this page

Search results