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.
deleteWordView()  : void
Delete word (iframe view).
editTerm()  : void
Edit term while testing.
editWord()  : void
Edit word form.
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.
displayEditTermForm()  : void
Display the edit term form.
displayEditWordForm()  : void
Display the word edit form (new or existing).
getWordFormData()  : array<string, mixed>
Get form data for word create/update operations.
handleEditTermOperation()  : bool
Handle update operation for edit term.
handleEditWordOperation()  : bool
Handle save/update operation for word edit.

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

deleteWordView()

Delete word (iframe view).

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

Replaces delete_word.php - deletes a word and renders confirmation.

Parameters
$params : array<string, string>

Route parameters

editTerm()

Edit term while testing.

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

Call: ?wid=[wordid] - display edit form ?op=Change - update the term

Parameters
$params : array<string, string>

Route parameters

editWord()

Edit word form.

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

Handles:

  • Display edit form: ?wid=[wordid] or ?tid=[textid]&ord=[ord]
  • Save/Update: ?op=Save or ?op=Change
Parameters
$params : array<string, string>

Route parameters

editWordById()

Edit word by ID.

public editWordById(int $id) : void

Route: GET/POST /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

displayEditTermForm()

Display the edit term form.

private displayEditTermForm() : void

displayEditWordForm()

Display the word edit form (new or existing).

private displayEditWordForm(int $wid, int $textId, int $ord, string $fromAnn) : void
Parameters
$wid : int

Word ID (-1 for new)

$textId : int

Text ID

$ord : int

Word order position

$fromAnn : string

From annotation flag

getWordFormData()

Get form data for word create/update operations.

private getWordFormData() : array<string, mixed>
Return values
array<string, mixed>

Form data array

handleEditTermOperation()

Handle update operation for edit term.

private handleEditTermOperation(string $translation) : bool
Parameters
$translation : string

Translation value

Return values
bool

True if error response was rendered, false otherwise

handleEditWordOperation()

Handle save/update operation for word edit.

private handleEditWordOperation() : bool
Return values
bool

True if error response was rendered, false otherwise


        
On this page

Search results