Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • Hawk\App
  • Hawk\ButtonInput
  • Hawk\Cache
  • Hawk\CheckboxInput
  • Hawk\ColorInput
  • Hawk\Conf
  • Hawk\Controller
  • Hawk\Crypto
  • Hawk\DatabaseSessionHandler
  • Hawk\DatetimeInput
  • Hawk\DB
  • Hawk\DBExample
  • Hawk\DeleteInput
  • Hawk\Dialogbox
  • Hawk\EmailInput
  • Hawk\ErrorHandler
  • Hawk\Event
  • Hawk\FileInput
  • Hawk\FileSystem
  • Hawk\FloatInput
  • Hawk\Form
  • Hawk\FormFieldset
  • Hawk\FormInput
  • Hawk\GenericModel
  • Hawk\GifImage
  • Hawk\HawkApi
  • Hawk\HawkUpdater
  • Hawk\HiddenInput
  • Hawk\HtmlInput
  • Hawk\HTTPRequest
  • Hawk\Icon
  • Hawk\Image
  • Hawk\IntegerInput
  • Hawk\ItemList
  • Hawk\ItemListField
  • Hawk\JpegImage
  • Hawk\Lang
  • Hawk\Language
  • Hawk\LeftSidebarTab
  • Hawk\Less
  • Hawk\Logger
  • Hawk\Mail
  • Hawk\MenuItem
  • Hawk\Model
  • Hawk\NoSidebarTab
  • Hawk\NumberInput
  • Hawk\ObjectInput
  • Hawk\Option
  • Hawk\Panel
  • Hawk\PasswordInput
  • Hawk\Permission
  • Hawk\Plugin
  • Hawk\PluginInstaller
  • Hawk\PngImage
  • Hawk\ProfileQuestion
  • Hawk\ProfileQuestionValue
  • Hawk\RadioInput
  • Hawk\Request
  • Hawk\Response
  • Hawk\RightSidebarTab
  • Hawk\Role
  • Hawk\RolePermission
  • Hawk\Route
  • Hawk\Router
  • Hawk\SelectInput
  • Hawk\Session
  • Hawk\Singleton
  • Hawk\SubmitInput
  • Hawk\Tabs
  • Hawk\TextareaInput
  • Hawk\TextInput
  • Hawk\Theme
  • Hawk\TimeInput
  • Hawk\Upload
  • Hawk\User
  • Hawk\View
  • Hawk\View\Plugins\Accordion
  • Hawk\View\Plugins\Button
  • Hawk\View\Plugins\Form
  • Hawk\View\Plugins\Icon
  • Hawk\View\Plugins\Import
  • Hawk\View\Plugins\Panel
  • Hawk\View\Plugins\Tabs
  • Hawk\View\Plugins\Text
  • Hawk\View\Plugins\Uri
  • Hawk\View\Plugins\Widget
  • Hawk\ViewPlugin
  • Hawk\Widget
  • Hawk\WysiwygInput

Traits

  • Hawk\Utils

Exceptions

  • Hawk\AppStopException
  • Hawk\DBExampleException
  • Hawk\DBException
  • Hawk\FileSystemException
  • Hawk\HawkApiException
  • Hawk\ImageException
  • Hawk\MailException
  • Hawk\UploadException
  • Hawk\ViewException
 1 <?php
 2 /**
 3  * ViewPlugin.php
 4  *
 5  * @author  Elvyrra SAS
 6  * @license http://rem.mit-license.org/ MIT
 7  */
 8 
 9 namespace Hawk;
10 
11 /**
12  * This abstract class defines the view plugins. It must be inherited by any class that defines any view plugin.
13  * This class is called when, in a view, you write something like that :
14  * {pluginName param="value1" param2="{$variable}" }
15  *
16  * @package View\Plugins
17  */
18 abstract class ViewPlugin{
19     use Utils;
20 
21     /**
22      * The filename of the view that calls the plugin
23      *
24      * @var string
25      */
26     protected $viewFile,
27 
28     /**
29      * The data in the parent view that calls the plugin
30      *
31      * @var array
32      */
33     $viewData,
34 
35     /**
36      * The plugin instance parameters
37      *
38      * @var array
39      */
40     $params;
41 
42     /**
43      * Contructor
44      *
45      * @param string $viewFile The view file that instances this plugin
46      * @param array  $viewData The data injected in the view
47      * @param array  $params   The instance parameters
48      */
49     public function __construct($viewFile, $viewData = array(), $params = array()){
50         $this->viewFile = $viewFile;
51         $this->viewData = $viewData;
52 
53         if(isset($params['_attrs'])) {
54             $params = $params['_attrs'];
55         }
56 
57         $this->params = $params;
58         $this->map($params);
59     }
60 
61     /**
62      * Display the plugin. This abstract method must be overriden in each inherited class and return the HTML content corresponding to the instance
63      *
64      * @return string The HTML result to display
65      */
66     abstract public function display();
67 
68     /**
69      * Display the plugin. This abstract method must be overriden in each inherited class and return the HTML content corresponding to the instance
70      *
71      * @return string The HTML result to display
72      */
73     public function __toString(){
74         return $this->display();
75     }
76 }
77 
Hawk - PHP documentation API documentation generated by ApiGen