ydarwin
Usuario (Bolivia)
Saludos estimados taringueros desde hace varios meses que vengo incursionando en CodeIngniter, aca les dejo un listado de lo fascinante que es este framework para PHP 1.- Creas aplicaciones muchos mas rapidas (al comienzo vas un poco lento pero luego notas la diferencia al tener todo organizado) 2.- Instalando HMVC puedes crear aplicaciones independientes entre si o crear varios modulos como si cada uno fuera una aplicacion distinta (Total separacion, programacion modular). 3.- Te ahorras escribiendo codigo en un 50% (al menos hasta ahora me he ahorrado eso) 4.- Puedes reusar tus librerias, modelos... (solo copias y pegas en un nuevo proyecto, que belleza!!!) Bueno pero el fin de este POST es para que si necesitas ayuda me contactes a [email protected] pronto habilitare un sitio para todas las dudas que tengan y poder darles ejemplos, ahora estoy haciendo un proyecto grande con codeigniter pero esta saliendo muy facil jeje, gracias a este maravilloso framework (tambien te ayuda mucho aprender, JQUERY, MySQL, CSS....)
Curso Taller de Code Igniter Básico - Avanzado con HMVC, ejemplo final del curso Catalogo Online con panel de administración.El curso se llevara acabo atravez de este post en TARINGA, aquellos que quieran recibir por e-mail la fecha de inicio enviarme un mensaje por TARINGA para anotarlos y enviarles la fecha de inicio y lugar (Internet).
dijo:Por Darwin Naranjo - [email protected] les pego el codigo en PHP de la libreria mas abajo indico como usarlo:Nombre del archivo cssjs.phpColocar en librariesnombre de la libreria cssjs.Forma de uso:$this->load->library('cssjs');/* Definimos el PATH donde estan nuestros CSS */$this->cssjs->set_path_css(base_url() . APP_PATH_CSS);/* Definimos el PATH donde estan nuestros JS */$this->cssjs->set_path_js(base_url() . APP_PATH_JS);/* AGREGAMOS ALGUNOS CSS */$this->cssjs->add_css(array('estilos', 'style')); /* OJO no es nececario poner .css*/ó tambien$this->cssjs->add_css('style');ó tambien si quieres usar otros paths puedes hacer esto$this->cssjs->add_css('http://www.misitio.com/css/style.css', FALSE); /* agregas otro parametro FALSE para tus propios paths personalizados *//* AGREGAMOS ALGUNOS JS */$this->cssjs->add_js(array('home', 'jquery')); /* OJO no es nececario poner .js*/ó tambien$this->cssjs->add_js('jquery');ó tambien si quieres usar otros paths puedes hacer esto$this->cssjs->add_css('http://www.misitio.com/js/jquery.js?v=2.3', FALSE, FALSE); /* el segundo parametro es para indicar tus propios PATHS no es necesario que pongas el .js, pero a veces hay ocaciones que JS se llaman con parametros entonces utilizas un tercer parametro y pones FALSE */BUENO aqui esta la libreria, cualquier duda o consulta me escriben.<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');class Cssjs{ var $css; var $js; var $path_css; var $path_js; function Cssjs(){ $this->path_css = base_url() . 'css/'; $this->path_js = base_url() . 'js/'; $this->clear(); } function clear_css(){ $this->css = array(); } function clear_js(){ $this->js = array(); } function clear(){ $this->css = array(); $this->js = array(); } function set_path_css($path){ if(is_string($path)): $this->path_css = $path; return TRUE; else: return FALSE; endif; } function set_path_js($path){ if(is_string($path)): $this->path_js = $path; return TRUE; else: return FALSE; endif; } function add_css($filename, $use_path = TRUE){ if(is_string($filename)): $this->css[] = '<link href="'. (($use_path===TRUE) ? $this->path_css : '') . $filename.'.css" rel="stylesheet" type="text/css" media="all" />'; return TRUE; else: if(is_array($filename) && count($filename) > 0): foreach($filename as $fname): $this->css[] = '<link href="'. (($use_path===TRUE) ? $this->path_css : '') . $fname.'.css" rel="stylesheet" type="text/css" media="all" />'; endforeach; return TRUE; else: return FALSE; endif; endif; } function add_js($filename, $use_path = TRUE, $use_ext = TRUE){ if(is_string($filename)): $this->js[] = '<script type="text/javascript" src="'.(($use_path === TRUE) ? $this->path_js : '') . $filename.(($use_ext === TRUE) ? '.js' : '').'"></script>'; return TRUE; else: if(is_array($filename) && count($filename) > 0): foreach($filename as $fname): $this->js[] = '<script type="text/javascript" src="'.(($use_path===TRUE) ? $this->path_js : '') . $fname.(($use_ext === TRUE) ? '.js' : '').'"></script>'; endforeach; return TRUE; else: return FALSE; endif; endif; } function get_css(){ return $this->css; } function get_js(){ return $this->js; } function generate_css(){ if(!empty($this->css)): $html = ''; foreach($this->css as $css): $html .= $css . "n"; endforeach; return $html; else: return ''; endif; } function generate_js(){ if(!empty($this->js)): $html = ''; foreach($this->js as $js): $html .= $js . "n"; endforeach; return $html; else: return ''; endif; } }/* End of file: cssjs.php */