本文整理汇总了PHP中HtmlElementFactory::crear_elemento方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlElementFactory::crear_elemento方法的具体用法?PHP HtmlElementFactory::crear_elemento怎么用?PHP HtmlElementFactory::crear_elemento使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlElementFactory
的用法示例。
在下文中一共展示了HtmlElementFactory::crear_elemento方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _generar_inputs_form
private function _generar_inputs_form()
{
$campos = $this->_oConfigEntidad->campos;
//echo "<hr/>" . __FILE__ . " - " . __LINE__ . "<pre>";
//echo "<hr/><pre>";
// print_r($this->input->post());
//echo "</pre><hr/>";
//die();
//$config = $this->input->post("campos[id_provincia][config]");
// $config_decode = (array) json_decode($config);
// print_r($config_decode);
// print_r($campos);
// echo "</pre><hr/>";
//die;
$html = "";
require_once APPPATH . "/libraries/Crud/HtmlElementFactory.php";
foreach ($campos as $nombre_campo => $data_campo) {
if (element($data_campo, "generar_input", 0) > 0) {
$tipo_input = $data_campo["tipo_campo"];
$config = $data_campo["config"];
$html .= "<div class='form-group'>" . PHP_EOL;
if ($tipo_input !== "hidden") {
$html .= "<label>" . element($data_campo, "label", "") . ":</label><br/>" . PHP_EOL;
}
$elemento_html = HtmlElementFactory::crear_elemento($tipo_input);
if (!empty($config)) {
$config_decode = (array) json_decode($config);
$elemento_html->set_config($config_decode);
}
$html .= $elemento_html->render($nombre_campo) . PHP_EOL;
$html .= "</div>" . PHP_EOL;
}
}
return $html;
}
示例2: test_html
public function test_html($tipo)
{
require_once APPPATH . "/libraries/Crud/HtmlElementFactory.php";
$obj = HtmlElementFactory::crear_elemento($tipo);
// echo "<hr/>" . __FILE__ . " - " . __LINE__ . "<pre>";
// var_dump($obj);
// echo "</pre><hr/>";
// echo $obj->render("foo", "bar");
// die();
}