Jannis Moßhammer 54ccb9b12a Move libraries from incubator to working tree for evaluation
Add all untested files from incubator's library/Icinga to working
tree library/Icinga

refs #4257
2013-06-07 15:46:33 +02:00

44 lines
973 B
PHP

<?php
/**
* Form
*/
namespace Icinga\Web\Widget;
/**
* A form loader...
*
* @copyright Copyright (c) 2013 Icinga-Web Team <info@icinga.org>
* @author Icinga-Web Team <info@icinga.org>
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
*/
class Form extends AbstractWidget
{
protected $form;
protected $properties = array(
'name' => null
);
public function __call($func, $args)
{
return call_user_func_array(array($this->form, $func), $args);
}
protected function init()
{
// Load form by name given in props?
$class = 'Icinga\\Web\\Form\\' . ucfirst($this->name) . 'Form';
$file = ICINGA_APPDIR
. '/forms/authentication/'
. ucfirst($this->name)
. 'Form.php';
require_once($file);
$this->form = new $class;
}
public function renderAsHtml()
{
return (string) $this->form;
}
}