class FindReplaceController extends AbstractController (View source)

Handles find and replace tab.

Displays find and replace form, allows previewing and do the replacing.

Properties

protected ResponseRenderer $response from  AbstractController
protected Template $template from  AbstractController
protected string $db from  AbstractController
protected string $table from  AbstractController

Methods

__construct(ResponseRenderer $response, Template $template, string $db, string $table, DatabaseInterface $dbi)

No description

void
render(string $templatePath, array $templateData = [])

No description

void
addScriptFiles(array $files)

No description

bool
hasDatabase()

No description

void
redirect(string $route, array $params = [])

No description

void
__invoke()

No description

void
displaySelectionFormAction()

Display selection form action

void
findAction()

No description

void
replaceAction()

No description

string
getReplacePreview(int $columnIndex, string $find, string $replaceWith, bool $useRegex, string $charSet)

Returns HTML for previewing strings found and their replacements

void
replace(int $columnIndex, string $find, string $replaceWith, bool $useRegex, string $charSet)

Replaces a given string in a column with a give replacement

Details

__construct(ResponseRenderer $response, Template $template, string $db, string $table, DatabaseInterface $dbi)

No description

Parameters

ResponseRenderer $response
Template $template
string $db
string $table
DatabaseInterface $dbi

protected void render(string $templatePath, array $templateData = [])

No description

Parameters

string $templatePath
array $templateData

Return Value

void

protected void addScriptFiles(array $files)

No description

Parameters

array $files

Return Value

void

protected bool hasDatabase()

No description

Return Value

bool

protected void redirect(string $route, array $params = [])

No description

Parameters

string $route
array $params

Return Value

void

void __invoke()

No description

Return Value

void

void displaySelectionFormAction()

Display selection form action

Return Value

void

void findAction()

No description

Return Value

void

void replaceAction()

No description

Return Value

void

string getReplacePreview(int $columnIndex, string $find, string $replaceWith, bool $useRegex, string $charSet)

Returns HTML for previewing strings found and their replacements

Parameters

int $columnIndex

index of the column

string $find

string to find in the column

string $replaceWith

string to replace with

bool $useRegex

to use Regex replace or not

string $charSet

character set of the connection

Return Value

string

HTML for previewing strings found and their replacements

void replace(int $columnIndex, string $find, string $replaceWith, bool $useRegex, string $charSet)

Replaces a given string in a column with a give replacement

Parameters

int $columnIndex

index of the column

string $find

string to find in the column

string $replaceWith

string to replace with

bool $useRegex

to use Regex replace or not

string $charSet

character set of the connection

Return Value

void