Automad
 All Classes Functions Variables Pages
Extensions\Navbar Class Reference

Public Member Functions

 Navbar ($options, $Automad)
 

Detailed Description

The Navbar extension creates the markup of a Twitter Bootstrap Navbar for multiple levels. To be used, Twitter's Bootstrap CSS and JS files are required.

Author
Marc Anton Dahmen hello.nosp@m.@mar.nosp@m.cdahm.nosp@m.en.d.nosp@m.e
License
MIT license - http://automad.org/license

Definition at line 26 of file navbar.php.

Member Function Documentation

Extensions\Navbar::Navbar (   $options,
  $Automad 
)

Every extension has one main method which will be called when parsing a template file. The name of that method is the same name as the name of the class and subnamespace (case insensitive). The .php file of the class gets simply the same name as the containing folder: /extensions/navbar/navbar.php

In this case the naming pattern looks like:

  • namespace: Extensions
  • directory: /extensions/navbar
  • class file: /extensions/navbar/navbar.php
  • class: Navbar
  • method: Navbar

This main method must always have two parameters, which will be passed automatically when calling the extension: $obj->Navbar($options, $Automad)

  • $options: An array with all the options
  • $Automad: The Automad object, to make all the Site's data available for the extension

Note: The Navbar method is not a kind of constructor (like it would be in PHP 4). Since this is a namespaced class, a method with the same name as the last part of the namespace isn't called when creating an instance of the class (PHP 5.3+).

Parameters
array$options
object$Automad
Returns
The generated HTML.

Definition at line 54 of file navbar.php.

References Automad\Core\Html\addImage(), Automad\Core\Html\addLink(), and Automad\Core\Html\generateSearchField().


The documentation for this class was generated from the following file: