Page MenuHomeGitPull.it

class-Page.php
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

class-Page.php

<?php
# WikiCAPTCHA Control Room
# Copyright (C) 2019 Valerio Bozzolan and contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
/**
* A website page
*
* It's useful to print the header, the footer, and who knows
*/
class Page {
/**
* Custom arguments
*
* @var array
*/
protected $args;
/**
* Constructor
*
* @param array $args Custom arguments
*/
public function __construct( $args = [] ) {
$this->args = $args;
$this->prepare();
}
/**
* Set a page argument
*
* @param $name string
* @param $value mixed
* @return self
*/
protected function setArg( $name, $value ) {
$this->args[ $name ] = $value;
return $this;
}
/**
* Set the page title
*
* @param $title string
* @return self
*/
protected function setTitle( $title ) {
return $this->setArg( 'title', $title );
}
/**
* Do something at startup
*/
protected function prepare() {
// actually nothing. You can override this!
}
/**
* Print the site header
*/
public function printHeader() {
template( 'header', $this->args );
}
/**
* Print the site footer
*/
public function printFooter() {
template( 'footer', $this->args );
}
}

File Metadata

Mime Type
text/x-php
Expires
Thu, Nov 19, 04:02 (5 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2264675
Default Alt Text
class-Page.php (1 KB)

Event Timeline