Main /

GlPage

glPage version 0.3.beta

The zip file obtained from geekLog contains:

  • a directory 'glpage' to upload to your installation in public_html
  • a directory 'testing' to be used in command line interface for testing features
  • a directory '_examples' to learn what is needed to use the new glPage class
  • this readme.md file

The directory 'glpage' is downloadable here as Attach:glpage.zip.

  1. Upload 'glpage' into the public_html location.
  2. Insert 'include_once ../glpage/proxy.php' directly after the include of lib_common.php.
  3. Learn from the examples how to use the API; compare the examples (diff)

Contents of glpage:

  • classes/glPage.class.php
  • classes/exception/glErrorHandler.class.php
  • proxy.php

Contents of _testing:

  • _gl/.... various copied classes of geeklog 2 needed to operate while cli testing
  • test.php main code to execute using cli 'php test.php'
  • testSupport.php included file to emulate geeklog
  • testPage.php included file with various API calls and debug prints.

Contents of _examples:

  • logviewer.php being a adjusted copy of admin/logviewer.php
  • myform.php being a example script that processes a posted form
  • myform_tpl.php being same but using a template thru addTemplate()
  • screenshots of logviewer and myform (center block)
  • resources ./css, ./js and ./fonts used by bootstrap.

The glPage class is principally a static factory for page objects. The static singleton contains a Outline, basicly the name of the overal page. After setting the outline name, page objects can be instantiated. The initial one is instantiated within proxy.php with the name 'geeklog' in the variable $_PAGE. A page object must have one or more layout(s) added, which is referenced when setting or adding content. Messages can be added per layout. A skin can be added per layout. A page object can be rendered by getting the pageContent or calling renderPage. $_PAGE->getPageContent() delivers the content your code created. $_PAGE->renderPage() delivers the complete page as a geeklog page.

WTF is a layout? A layout is a string containing names of blocks that reference your wireframe setup. Such a name will be unique. Same names refer to same content. Beware !! Example: 'header,body,footer'. No spaces allowed !! A layout can contain css-namespaces for the class attribute and the id attribute. Example: 'header:myID:myClass'. Note: a layout named 'prefix' or 'suffix' will NOT be glued and are considered as the actual glue. This is needed for forms and alike to separate the form tag and the its closing tag.

WTF is a css-namespace? Most html tags can contain a class attribute which are referenced in css stylesheets. These class attributes can force a naming clash and therefor class names are prefixed with a namespace identifier. Same goes for id attributes. Namespace identifiers can be set for any named layout but are not inherited.

WTF is a skin? A special class name can be attached to any layoutname. Even multiple. The css must define the special skinny features.

WTF is a Resource? A resource is either a js, either a css. A resource can be added or set. CSS resources always appear in the head, while JS resources appear in the head by setResource() or are appended at the end by addResource(). Single scripts code and/or style code can be inserted also by addScript() and/or addStyle(). Similar works addLibary() and setLibrary().

Well, well. Messages? Yes. Messages will display stacked on top (as Geeklog does). However, by supplying the name of the layout containerin addMessage(), the messages can insert in the very container.

Huh! Exceptions? Yes, sure, exceptions. glPage is throwing exceptions (and catches them) when appropiate. The glErrorHandler.class is handling uncaught exceptions and hopefully will make it to the GL core sometime.

ChangeLog. 03.beta.

  • reshuffled the code to optimize human readings.
  • resolved roadmap issues.
  • added *fix layout containers bypassing glue-ing; f.i. prefix and suffix.
  • added API validation to detect unintended recursion and other ill-usage.
  • more Exceptions thrown.
  • optimized the glue for socalled Blocks.
  • added id-attribute to fieldset (glue).
  • added a form processing app as example.
  • several tunings favoring bootstrap.css.

02.beta.

  • added some standard GL components neede for executing a CLI test.

01.beta.

  • initial upload.

RoadMap.

2015:

  • development stalled

2014:

  • renderPage will not return any more, but smoothly exit. done
  • addSkin will insert a resource for the added Skin. done
  • template processing if a template is added. done
  • exception debugging only for admin. done

Have fun. Current code is totally free and donated to you.
'Use it 'as is' and on your own risk.'
There is nothing to claim when the code fails, crashes your site or whatsoever.