Edición de «KumbiaPHP Framework Versión 1.0 Beta2»
De KumbiaPHP Framework Wiki
Advertencia: no has iniciado sesión. Tu dirección IP se hará pública si haces cualquier edición. Si inicias sesión o creas una cuenta, tus ediciones se atribuirán a tu nombre de usuario, además de otros beneficios.
Puedes deshacer la edición. Antes de deshacer la edición, comprueba la siguiente comparación para verificar que realmente es lo que quieres hacer, y entonces guarda los cambios para así efectuar la reversión.
Revisión actual | Tu texto | ||
Línea 52: | Línea 52: | ||
== Helpers == | == Helpers == | ||
− | |||
− | |||
− | |||
=== Clase Html === | === Clase Html === | ||
Línea 122: | Línea 119: | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Línea 167: | Línea 150: | ||
<source lang=php> | <source lang=php> | ||
Html::meta('Kumbiaphp-team',"name = 'Author'"); | Html::meta('Kumbiaphp-team',"name = 'Author'"); | ||
− | + | charset=UTF-8" http-equiv = 'Content-type'/> | |
echo Html::includeMetatags(); //Visualiza <meta content="Kumbiaphp-team" name = 'Author'/> | echo Html::includeMetatags(); //Visualiza <meta content="Kumbiaphp-team" name = 'Author'/> | ||
</source> | </source> | ||
+ | |||
+ | |||
==== Html::headLink() ==== | ==== Html::headLink() ==== | ||
Línea 182: | Línea 167: | ||
<source lang="php" line> | <source lang="php" line> | ||
− | + | Html::headlink('http://www.kumbiaphp.com/public/style.css',"rel='stylesheet',type='text/css' media='screen'"); //Se agrega a la cola de links el enlace a un recurso externo, en este caso la hoja de estilo ubicada en "http://www.kumbiaphp.com/public/style.css" | |
− | Html::headlink('http://www.kumbiaphp.com/public/style.css',"rel='stylesheet',type='text/css' media='screen'"); | ||
/*Agrega a la cola de links "<link rel="alternate" type="application/rss+xml" title="KumbiaPHP Framework RSS Feed" href="http://www.kumbiaphp.com/blog/feed/" />" con lo cual podemos incluir un feed sin usar las convenciones de kumbiaphp */ | /*Agrega a la cola de links "<link rel="alternate" type="application/rss+xml" title="KumbiaPHP Framework RSS Feed" href="http://www.kumbiaphp.com/blog/feed/" />" con lo cual podemos incluir un feed sin usar las convenciones de kumbiaphp */ | ||
Línea 244: | Línea 228: | ||
echo Html::includeHeadLinks(); | echo Html::includeHeadLinks(); | ||
</source> | </source> | ||
+ | |||
+ | |||
+ | |||
=== '''Clase Tag''' === | === '''Clase Tag''' === | ||
Línea 262: | Línea 249: | ||
Incluye un archivo JavaScript a la vista, partial o template | Incluye un archivo JavaScript a la vista, partial o template | ||
<source lang=php> | <source lang=php> | ||
− | <?php echo Tag::js('jquery/ | + | <?php echo Tag::js('jquery/jquery.kumbiaphp');?> //Adiciona un archivo javascript (app/public/javascript/jquery/jquery.kumbiaphp) |
− | |||
− | |||
</source> | </source> | ||
Línea 418: | Línea 403: | ||
==== Form::dbSelect() ==== | ==== Form::dbSelect() ==== | ||
− | Crea un | + | Crea campo Select que toma los valores de un array de objetos de ActiveRecord |
+ | <pre> | ||
+ | $field nombre de campo | ||
+ | $data array de valores para la lista desplegable | ||
+ | $show campo que se mostrara | ||
+ | $blank campo en blanco | ||
+ | $attrs atributos de campo | ||
+ | $value valor inicial para el campo oculto | ||
− | + | dbSelect($field, $data, $show, $blank = NULL, $attrs = NULL, $value = NULL) | |
+ | </pre> | ||
− | + | Controlador | |
− | <source lang=php> | + | <source lang=php> |
− | + | $usuarios = new Usuarios(); | |
− | + | $this->usuarios = $usuarios->find(); | |
− | + | </source> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Vista | |
− | + | <source lang=php> | |
− | <source lang=php>Form::dbSelect(' | + | echo Form::dbSelect('usuarios.id', $usuarios, 'nombres', '- seleccione -'); |
− | + | </source> | |
− | |||
− | |||
− | |||
− | |||
− | |||
==== Form::select() ==== | ==== Form::select() ==== | ||
Línea 463: | Línea 441: | ||
echo Form::Select('region', $ar2,'Cuello'); //Crea un campo Select (un combobox) con el nombre 'region' y teniendo preseleccionado 'Cuello' | echo Form::Select('region', $ar2,'Cuello'); //Crea un campo Select (un combobox) con el nombre 'region' y teniendo preseleccionado 'Cuello' | ||
</source> | </source> | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==== Form::file() ==== | ==== Form::file() ==== | ||
Línea 499: | Línea 457: | ||
echo Form::close(); //Cierra el formulario | echo Form::close(); //Cierra el formulario | ||
</source> | </source> | ||
+ | |||
==== Form::button() ==== | ==== Form::button() ==== | ||
Línea 515: | Línea 474: | ||
==== Form::submitImage() ==== | ==== Form::submitImage() ==== | ||
− | Crea un botón de tipo imagen siguendo las convenciones de kumbiaphp, la imagen | + | Crea un botón de tipo imagen siguendo las convenciones de kumbiaphp, la imagen devera estar dentro del directorio '/public/img/' |
<pre> | <pre> | ||
$img ruta de la imagen que usa el botón | $img ruta de la imagen que usa el botón | ||
Línea 526: | Línea 485: | ||
echo Form::submitImage('botones/edit.gif'); //Crea un botón con la imagen 'botones/edit.gif' | echo Form::submitImage('botones/edit.gif'); //Crea un botón con la imagen 'botones/edit.gif' | ||
</source> | </source> | ||
+ | |||
==== Form::submit() ==== | ==== Form::submit() ==== | ||
Línea 563: | Línea 523: | ||
$checked indica si se marca el campo | $checked indica si se marca el campo | ||
− | check($field, $value, $attrs = NULL, $checked = NULL) | + | check($field, $value, $attrs = NULL, $checked = NULL) |
</pre> | </pre> | ||
Línea 1026: | Línea 986: | ||
$img = Upload::factory('imagen', 'image'); | $img = Upload::factory('imagen', 'image'); | ||
− | // | + | // Formatos de Imagenes |
− | + | $img->setTypes(array('jpg', 'gif', 'png')); | |
− | $img->setTypes(array(' | ||
</source> | </source> | ||
Línea 1043: | Línea 1002: | ||
$img = Upload::factory('imagen', 'image'); | $img = Upload::factory('imagen', 'image'); | ||
− | // | + | // Archivos de Imagenes |
$img->setExtensions(array('jpg', 'gif', 'png')); | $img->setExtensions(array('jpg', 'gif', 'png')); | ||
− | |||
</source> | </source> | ||
Línea 1184: | Línea 1142: | ||
<?php echo Form::close() ?> | <?php echo Form::close() ?> | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |