# Opac

class Opac

## Methods

__construct(array $definedVariable, array $sysconf, $dbs)

Opac constructor

void
hookBeforeContent(Closure $callback)

Hook process before content

void
hookAfterContent(Closure $callback)

Hook process after content

static void
filterPath(string $path)

Filter path string

void
generateKeywords(array $advanceSearch = [])

Generate search keywords into array javascript with Json::stringify

void
setHeader(string $headerName, string $headerValue)

Set HTTP header

void
getCsrf()

Get CSRF token

void
validateCsrf()

Validate csrf token

void
setCsp(array $additionalCsp = [])

Set Content Security Policy

void
parseToTemplate()

Parse content to template

onWeb(Closure $callback)

No description

onCli()

No description

void
handle(string $path)

Handle request based on $_GET['p'];

void
orWelcome()

Parse default content

void
toJson(mix $data)

Output content as JSON with header

void
mutateConf($key, $value)

Mutatate an existing key in sysconf we don't want to add new key directly

__set(string $key, string $value)

Setter for definedVariable property

__get(string $key)

Getter for sysconf & definedVariable property

## Details

###
at line 37
`__construct(array $definedVariable, array $sysconf, $dbs)`

Opac constructor

#### Parameters

array | $definedVariable |
array | $sysconf |
| $dbs |

###
at line 50
`void hookBeforeContent(Closure $callback)`

Hook process before content

#### Parameters

Closure | $callback |

#### Return Value

void |

###
at line 62
`void hookAfterContent(Closure $callback)`

Hook process after content

#### Parameters

Closure | $callback |

#### Return Value

void |

###
at line 74
`static void filterPath(string $path)`

Filter path string

#### Parameters

string | $path |

#### Return Value

void |

###
at line 92
`void generateKeywords(array $advanceSearch = [])`

Generate search keywords into array javascript with Json::stringify

#### Parameters

array | $advanceSearch |

#### Return Value

void |

###
at line 220
`void setHeader(string $headerName, string $headerValue)`

Set HTTP header

#### Parameters

string | $headerName |
string | $headerValue |

#### Return Value

void |

###
at line 241
`void getCsrf()`

Get CSRF token

#### Return Value

void |

###
at line 251
`void validateCsrf()`

Validate csrf token

#### Return Value

void |

###
at line 266
`void setCsp(array $additionalCsp = [])`

Set Content Security Policy

#### Parameters

array | $additionalCsp |

#### Return Value

void |

###
at line 277
`void parseToTemplate()`

Parse content to template

#### Return Value

void |

###
at line 311
`onWeb(Closure $callback)`

No description

#### Parameters

Closure | $callback |

###
at line 317
`onCli()`

No description

###
at line 328
`void handle(string $path)`

Handle request based on $_GET['p'];

#### Parameters

string | $path |

#### Return Value

void |

###
at line 357
`void orWelcome()`

Parse default content

#### Return Value

void |

###
at line 403
`void toJson(mix $data)`

Output content as JSON with header

#### Parameters

mix | $data |

#### Return Value

void |

###
at line 417
`void mutateConf($key, $value)`

Mutatate an existing key in sysconf we don't want to add new key directly

#### Parameters

| $key |
| $value |

#### Return Value

void |

###
at line 429
`__set(string $key, string $value)`

Setter for definedVariable property

#### Parameters

string | $key |
string | $value |

###
at line 440
`__get(string $key)`

Getter for sysconf & definedVariable property

#### Parameters

string | $key |