本文整理匯總了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();
}