PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 1.4
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v1.4
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
bit-form / includes / Core / Form / FormHandler.php

FormHandler.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 1.4, at includes/Core/Form/FormHandler.php

69 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace BitCode\BitForm\Core\Form;
3
4 use BitCode\BitForm\Core\Capability\Request;
5 use BitCode\BitForm\Admin\Form\AdminFormHandler;
6 use BitCode\BitForm\Frontend\Form\FrontendFormHandler;
7
8 final class FormHandler
9 {
10 private $_container = array();
11 private static $_instance = null;
12 /**
13 * Undocumented function
14 */
15 public static function getInstance()
16 {
17 if (self::$_instance === null) {
18 self::$_instance = new FormHandler();
19 }
20 return self::$_instance;
21 }
22
23 public function __construct()
24 {
25 if (Request::Check('frontend')) {
26 $this->load_public_form_handler();
27 }
28 if (Request::Check('admin')) {
29 $this->load_admin_form_handler();
30 }
31 }
32 /**
33 * Magic getter function
34 *
35 * @param $object
36 *
37 * @return mixed
38 */
39 public function __get($object)
40 {
41 if (array_key_exists($object, $this->_container)) {
42 return $this->_container[ $object ];
43 }
44
45 return $this->{$object};
46 }
47
48 /**
49 * Magic isset function
50 *
51 * @param $object
52 *
53 * @return mixed
54 */
55 public function __isset($object)
56 {
57 return isset($this->{$object}) || isset($this->container[ $object ]);
58 }
59 public function load_admin_form_handler()
60 {
61 $this->_container['admin'] = new AdminFormHandler();
62 }
63
64 protected function load_public_form_handler()
65 {
66 $this->_container['frontend'] = new FrontendFormHandler();
67 }
68 }
69