Documentation

TermDisplayController extends VocabularyBaseController
in package

Controller for viewing terms and hover interactions.

Handles:

  • GET /word/{wid} - Show word details
  • /word/show - Show word details (legacy)
  • /vocabulary/term-hover - Hover create from reading view
  • /vocabulary/similar-terms - Get similar terms
  • /words - List/edit words (Alpine.js)
  • /words/edit - Edit words list
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.
$createTermFromHover  : CreateTermFromHover
Use cases.
$dictionaryAdapter  : DictionaryAdapter
Adapters.
$facade  : VocabularyFacade
Vocabulary facade.
$findSimilarTerms  : FindSimilarTerms
$languageFacade  : LanguageFacade
Services.

Methods

__construct()  : mixed
Constructor.
edit()  : void
Show term edit form.
hoverCreate()  : void
Handle the hover create action from reading view.
listEditAlpine()  : void
List/edit words - Alpine.js SPA version.
setViewPath()  : void
Set custom view path.
show()  : void
Show term details.
showWord()  : void
Show word details.
similarTerms()  : void
Get similar terms for a given term.
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.
createFromHover()  : array<string|int, mixed>
Create a term from hover action in reading view.
getDictionaryLinks()  : string
Get dictionary links for editing.

Properties

Methods

__construct()

Constructor.

public __construct([VocabularyFacade|null $facade = null ][, CreateTermFromHover|null $createTermFromHover = null ][, FindSimilarTerms|null $findSimilarTerms = null ][, DictionaryAdapter|null $dictionaryAdapter = null ][, LanguageFacade|null $languageFacade = null ]) : mixed
Parameters
$facade : VocabularyFacade|null = null

Vocabulary facade

$createTermFromHover : CreateTermFromHover|null = null

Create term from hover use case

$findSimilarTerms : FindSimilarTerms|null = null

Find similar terms use case

$dictionaryAdapter : DictionaryAdapter|null = null

Dictionary adapter

$languageFacade : LanguageFacade|null = null

Language facade

edit()

Show term edit form.

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

Route parameters

hoverCreate()

Handle the hover create action from reading view.

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

This is the route handler that parses request params and renders the result view.

Parameters
$params : array<string, string>

Route parameters

listEditAlpine()

List/edit words - Alpine.js SPA version.

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

Route parameters

Tags
psalm-suppress

UnresolvableInclude Path computed from viewPath property

setViewPath()

Set custom view path.

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

View path

show()

Show term details.

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

Route parameters

showWord()

Show word details.

public showWord([int|null $wid = null ]) : void

Routes:

  • GET /word/{wid:int} (new RESTful route)
  • GET /word/show?wid=[wordid] (legacy route)

Optional query parameter: ann=[annotation]

Parameters
$wid : int|null = null

Word ID (injected from route parameter)

similarTerms()

Get similar terms for a given term.

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

Route parameters

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

createFromHover()

Create a term from hover action in reading view.

private createFromHover(int $textId, string $wordText, int $status[, string $sourceLang = '' ][, string $targetLang = '' ]) : array<string|int, mixed>
Parameters
$textId : int

Text ID

$wordText : string

Word text

$status : int

Word status (1-5)

$sourceLang : string = ''

Source language code

$targetLang : string = ''

Target language code

Return values
array<string|int, mixed>

Term creation result

Get dictionary links for editing.

private getDictionaryLinks(int $langId, string $word, string $sentctlid[, bool $openFirst = false ]) : string
Parameters
$langId : int

Language ID

$word : string

Word to look up

$sentctlid : string

Sentence control ID

$openFirst : bool = false

Open first dictionary

Return values
string

HTML dictionary links


        
On this page

Search results