Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:controller:archivesapicontroller

ArchivesApiController

Layer: Controller · Source: lib/controller/api/ArchivesApiController.php:29 (lines 29–265)


class ArchivesApiController extends ApiController

Archives API Controller

Handles API requests for post archives (by date)

Docblock Metadata

Tag Value
@category Controller Class
@author Blogware Team
@license MIT
@version 1.0
@since Since Release 1.0

Inheritance

Relation Type Meaning
extends ''ApiController'' parent class/interface

Constants (0)

None.

Properties (2)

Visibility Type Name Default Line
private (untyped) $hateoas 34
private (untyped) $postService 39

Methods (5)

Visibility Method Summary Line
public __construct() Constructor 44
public index() Get list of available archive dates (public endpoint) 63
public year() Get posts from a specific year (public endpoint) 115
public month() Get posts from a specific month (public endpoint) 177
private getMonthName() Get month name 246

__construct()

public function __construct()

lines 44–51 (8)

Constructor

Takes no parameters.

index()

public function index($_params = [])

lines 63–105 (43)

Get list of available archive dates (public endpoint)

GET /api/v1/archives

Returns a list of years and months that have published posts

Parameter Type Default Description
$_params (untyped) [] none

Returns: (none declared) — void

year()

public function year($params = [])

lines 115–167 (53)

Get posts from a specific year (public endpoint)

GET /api/v1/archives/{year}

Parameter Type Default Description
$params (untyped) [] Route parameters including 'year'

Returns: (none declared) — void

month()

public function month($params = [])

lines 177–238 (62)

Get posts from a specific month (public endpoint)

GET /api/v1/archives/{year}/{month}

Parameter Type Default Description
$params (untyped) [] Route parameters including 'year' and 'month'

Returns: (none declared) — void

getMonthName()

private function getMonthName($month)

lines 246–264 (19)

Get month name

Parameter Type Default Description
$month (untyped) required none

Returns: (none declared) — string

Imports


This page is generated from source by 'tools/gendoc'. Edits will be overwritten.

scriptlog/lib/controller/archivesapicontroller.txt · Last modified: by admin