{"id":750,"date":"2015-03-17T21:05:46","date_gmt":"2015-03-17T21:05:46","guid":{"rendered":"http:\/\/luisrodriguez.pe\/blog\/?p=750"},"modified":"2015-03-17T21:05:46","modified_gmt":"2015-03-17T21:05:46","slug":"crear-helper-en-codeigniter","status":"publish","type":"post","link":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/","title":{"rendered":"Crear Helper en Codeigniter"},"content":{"rendered":"<p>Los helper son basicamente funciones que nos ayudaran en el proceso del desarrollo que podemos llamar desde las vistas o controladores y no digo modelos por que no se deberia llamarlos desde hay.<\/p>\n<p>crearlas son sumamente facil es mas si es que tienes una funcion ya escrita en php simplemente la puedes copiar y comodolar algunas cosas si es que esta trabajando con base de datos de lo contrario no deberia ser necesario mover nada y como suelo hacer poco floro y mas accion.<\/p>\n<p>ubicamos la carpeta donde debemos tener los helper y no es nada dificil por que codeigniter ya viene con una carpeta con ese nombre.<\/p>\n<p><a href=\"http:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-755\" src=\"http:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png\" alt=\"ubicacion_helper\" width=\"243\" height=\"327\" srcset=\"https:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png 243w, https:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper-223x300.png 223w\" sizes=\"(max-width: 243px) 100vw, 243px\" \/><\/a><\/p>\n<p>ahora puedes crear un archivo php pero debe tener un sufijo \u00ab_helper\u00bb por ejemplo en la imagen tengo 2 helper que se llama sistema y web pero cumpliendo con el requisito de codeigniter se debe colocar \u00ab_helper\u00bb y entonces queda sistema_helper y web_helper.<\/p>\n<p>ahora abrimos el archivo y comenzamos a programar y veran lo facil que es en este caso voy a crear 2 ejemplos de helper 1 basica y la otra utlizando base de datos.<\/p>\n<blockquote><p><strong>1)<\/strong> crearemos un helper que nos ayude a crear url amigables una funcion que le pasen un string y te devuelva una cadena para que pase tranquilamente como url.<\/p><\/blockquote>\n<p>&nbsp;<br \/>\n<code><\/p>\n\n<div class=\"wp_syntax\"><table><tr><td class=\"code\"><pre class=\"php\" style=\"font-family:monospace;\"><span style=\"color: #666666; font-style: italic;\">\/\/esto no es obligatorio pero por un tema de seguridad que nos dice si BASEPATH no esta definido no va a cargar<\/span>\n<span style=\"color: #b1b100;\">if<\/span> <span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #339933;\">!<\/span><span style=\"color: #990000;\">defined<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">'BASEPATH'<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span><span style=\"color: #990000;\">exit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">'No direct script access allowed'<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">&#125;<\/span>\n<span style=\"color: #666666; font-style: italic;\">\/\/aqui es simple preguntamos si no existe la funcion urls_amigables la podemos crear de lo contrario no se crea<\/span>\n<span style=\"color: #b1b100;\">if<\/span> <span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #339933;\">!<\/span><span style=\"color: #990000;\">function_exists<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">'urls_amigables'<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span>\n    <span style=\"color: #666666; font-style: italic;\">\/\/creamos la funcion y no explico mas sobre que es cada linea por que eso ya es otro tema.<\/span>\n    <span style=\"color: #000000; font-weight: bold;\">function<\/span> urls_amigables<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #000088;\">$url<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span>\n    <span style=\"color: #000088;\">$url<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">strtolower<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #000088;\">$url<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #000088;\">$find<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">array<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">'\u00c3\u00a1'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'\u00c3\u00a9'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'\u00c3\u00ad'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'\u00c3\u00b3'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'\u00c3\u00ba'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'\u00c3\u00b1'<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #000088;\">$repl<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">array<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">'a'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'e'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'i'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'o'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'u'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'n'<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #000088;\">$url<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">str_replace<\/span> <span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #000088;\">$find<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000088;\">$repl<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000088;\">$url<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #000088;\">$find<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">array<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">' '<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'&amp;amp;'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'\\r\\n'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'\\n'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'+'<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> \n    <span style=\"color: #000088;\">$url<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">str_replace<\/span> <span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #000088;\">$find<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'-'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000088;\">$url<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #000088;\">$find<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">array<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">'\/[^a-z0-9\\-&amp;lt;&amp;gt;]\/'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'\/[\\-]+\/'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'\/&amp;lt;[^&amp;gt;]*&amp;gt;\/'<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #000088;\">$repl<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">array<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">''<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">'-'<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">''<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #000088;\">$url<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">preg_replace<\/span> <span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #000088;\">$find<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000088;\">$repl<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #000088;\">$url<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #b1b100;\">return<\/span> <span style=\"color: #000088;\">$url<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #009900;\">&#125;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span><\/pre><\/td><\/tr><\/table><\/div>\n\n<p><\/code><br \/>\n&nbsp;<\/p>\n<blockquote><p><strong>2)<\/strong> queremos un helper que revise la base de datos y sepa cual es el ultimo codigo  que se tiene y a ese codigo le sumamos 1 para que sea consecutivo la secuencia de codigos (lo especial es como instaciamos para poder trabajar con la base de datos)<\/p><\/blockquote>\n<p><code><\/p>\n\n<div class=\"wp_syntax\"><table><tr><td class=\"code\"><pre class=\"php\" style=\"font-family:monospace;\"><span style=\"color: #666666; font-style: italic;\">\/\/esto no es obligatorio pero por un tema de seguridad que nos dice si BASEPATH no esta definido no va a cargar<\/span>\n<span style=\"color: #b1b100;\">if<\/span> <span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #339933;\">!<\/span><span style=\"color: #990000;\">defined<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">'BASEPATH'<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span><span style=\"color: #990000;\">exit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">'No direct script access allowed'<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">&#125;<\/span>\n<span style=\"color: #666666; font-style: italic;\">\/\/aqui es simple preguntamos si no existe la funcion urls_amigables la podemos crear de lo contrario no se crea<\/span>\n<span style=\"color: #b1b100;\">if<\/span> <span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #339933;\">!<\/span><span style=\"color: #990000;\">function_exists<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">'codigo_compra'<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#41;<\/span>\n<span style=\"color: #009900;\">&#123;<\/span>\n    <span style=\"color: #000000; font-weight: bold;\">function<\/span> codigo_compra<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span>\n    <span style=\"color: #009900;\">&#123;<\/span>\n        <span style=\"color: #666666; font-style: italic;\">\/\/para poder usar la base de datos en el helper debemos instanciar al core de codeigniter <\/span>\n        <span style=\"color: #000088;\">$CI<\/span><span style=\"color: #339933;\">=<\/span> <span style=\"color: #339933;\">&amp;<\/span> get_instance<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> \n        <span style=\"color: #666666; font-style: italic;\">\/\/al ser instanciado es el equivalente a $this que se tiene en control<\/span>\n        <span style=\"color: #666666; font-style: italic;\">\/\/el siguiente proceso facil de entender igual no va al caso<\/span>\n        <span style=\"color: #b1b100;\">if<\/span> <span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #000088;\">$CI<\/span><span style=\"color: #339933;\">-&gt;<\/span><span style=\"color: #004000;\">db<\/span><span style=\"color: #339933;\">-&gt;<\/span><span style=\"color: #004000;\">get<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">&quot;pedidos&quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">-&gt;<\/span><span style=\"color: #004000;\">num_rows<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">&gt;<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #009900;\">&#41;<\/span>\n        <span style=\"color: #009900;\">&#123;<\/span>\n            <span style=\"color: #000088;\">$num<\/span><span style=\"color: #339933;\">=<\/span><span style=\"color: #000088;\">$CI<\/span><span style=\"color: #339933;\">-&gt;<\/span><span style=\"color: #004000;\">db<\/span><span style=\"color: #339933;\">-&gt;<\/span><span style=\"color: #004000;\">order_by<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">&quot;id&quot;<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000ff;\">&quot;desc&quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">-&gt;<\/span><span style=\"color: #004000;\">get<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">&quot;pedidos&quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">-&gt;<\/span><span style=\"color: #004000;\">row_array<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n            <span style=\"color: #000088;\">$num<\/span><span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#40;<\/span>int<span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #000088;\">$num<\/span><span style=\"color: #009900;\">&#91;<\/span><span style=\"color: #0000ff;\">&quot;codigo&quot;<\/span><span style=\"color: #009900;\">&#93;<\/span><span style=\"color: #339933;\">;<\/span>\n            <span style=\"color: #b1b100;\">return<\/span> <span style=\"color: #990000;\">str_pad<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #000088;\">$num<\/span><span style=\"color: #339933;\">+<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #cc66cc;\">8<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">&quot;0&quot;<\/span><span style=\"color: #339933;\">,<\/span> STR_PAD_LEFT<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\n        <span style=\"color: #009900;\">&#125;<\/span>\n        <span style=\"color: #b1b100;\">else<\/span> \n        <span style=\"color: #009900;\">&#123;<\/span>\n            <span style=\"color: #b1b100;\">return<\/span> <span style=\"color: #990000;\">str_pad<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #cc66cc;\">10<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000ff;\">&quot;0&quot;<\/span><span style=\"color: #339933;\">,<\/span> STR_PAD_LEFT<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n        <span style=\"color: #009900;\">&#125;<\/span>\n    <span style=\"color: #009900;\">&#125;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span><\/pre><\/td><\/tr><\/table><\/div>\n\n<p><\/code><\/p>\n<p>si ya tiene cu helper lo unico que falta es cargarlo en al carpeta  config en el archivo autoload.php  y buscamos la linea donde muestra:<br \/>\n<code><\/p>\n\n<div class=\"wp_syntax\"><table><tr><td class=\"code\"><pre class=\"php\" style=\"font-family:monospace;\"><span style=\"color: #000088;\">$autoload<\/span><span style=\"color: #009900;\">&#91;<\/span><span style=\"color: #0000ff;\">'helper'<\/span><span style=\"color: #009900;\">&#93;<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">array<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><\/pre><\/td><\/tr><\/table><\/div>\n\n<p><\/code><\/p>\n<p>ahora solo debe colocar el nombre de tu helper para que cargue y no es necesario que coloques el sufijo \u00ab_helper\u00bb<\/p>\n<p><code><\/p>\n\n<div class=\"wp_syntax\"><table><tr><td class=\"code\"><pre class=\"php\" style=\"font-family:monospace;\"><span style=\"color: #000088;\">$autoload<\/span><span style=\"color: #009900;\">&#91;<\/span><span style=\"color: #0000ff;\">'helper'<\/span><span style=\"color: #009900;\">&#93;<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #990000;\">array<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000ff;\">&quot;mihelper&quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span><\/pre><\/td><\/tr><\/table><\/div>\n\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"Los helper son basicamente funciones que nos ayudaran en el proceso del desarrollo que podemos llamar desde las vistas o controladores y no digo modelos por que no se deberia llamarlos desde hay. crearlas son sumamente facil es mas si es que tienes una funcion ya escrita en php simplemente la puedes copiar y comodolar[&#8230;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,6],"tags":[74,83,82,25],"class_list":["post-750","post","type-post","status-publish","format-standard","hentry","category-desarrollo-web","category-php","tag-codeigniter","tag-funciones","tag-helper","tag-php-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Crear Helper en Codeigniter - Blog Luis Rodriguez<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Crear Helper en Codeigniter - Blog Luis Rodriguez\" \/>\n<meta property=\"og:description\" content=\"Los helper son basicamente funciones que nos ayudaran en el proceso del desarrollo que podemos llamar desde las vistas o controladores y no digo modelos por que no se deberia llamarlos desde hay. crearlas son sumamente facil es mas si es que tienes una funcion ya escrita en php simplemente la puedes copiar y comodolar[...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Luis Rodriguez\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/luisrodriguez.pe\" \/>\n<meta property=\"article:published_time\" content=\"2015-03-17T21:05:46+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png\" \/>\n<meta name=\"author\" content=\"Luis Rodriguez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@luizmirodriguez\" \/>\n<meta name=\"twitter:site\" content=\"@luizmirodriguez\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Luis Rodriguez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/\"},\"author\":{\"name\":\"Luis Rodriguez\",\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/#\/schema\/person\/ec55de81e01fdaf3533eb78f6a49090c\"},\"headline\":\"Crear Helper en Codeigniter\",\"datePublished\":\"2015-03-17T21:05:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/\"},\"wordCount\":310,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png\",\"keywords\":[\"codeigniter\",\"funciones\",\"helper\",\"php\"],\"articleSection\":[\"Desarrollo web\",\"PHP\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/\",\"url\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/\",\"name\":\"Crear Helper en Codeigniter - Blog Luis Rodriguez\",\"isPartOf\":{\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png\",\"datePublished\":\"2015-03-17T21:05:46+00:00\",\"author\":{\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/#\/schema\/person\/ec55de81e01fdaf3533eb78f6a49090c\"},\"breadcrumb\":{\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#primaryimage\",\"url\":\"https:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png\",\"contentUrl\":\"https:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png\",\"width\":243,\"height\":327},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/luisrodriguez.pe\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Crear Helper en Codeigniter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/#website\",\"url\":\"https:\/\/luisrodriguez.pe\/blog\/\",\"name\":\"Blog Luis Rodriguez\",\"description\":\"Analytics Developer\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/luisrodriguez.pe\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/luisrodriguez.pe\/blog\/#\/schema\/person\/ec55de81e01fdaf3533eb78f6a49090c\",\"name\":\"Luis Rodriguez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/3b0f9734b267ecb38e1860734b4caebda4efa8be9a2bb536862b6a2ba23afa82?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3b0f9734b267ecb38e1860734b4caebda4efa8be9a2bb536862b6a2ba23afa82?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3b0f9734b267ecb38e1860734b4caebda4efa8be9a2bb536862b6a2ba23afa82?s=96&d=mm&r=g\",\"caption\":\"Luis Rodriguez\"},\"description\":\"Hola, Soy Luis Rodriguez, radico en Lima \u2013 Per\u00fa, formado en una carrera inform\u00e1tica, desempe\u00f1ando desde el 2007 como programador web y viendo proyectos desde Front End y Back End a lo que me perfile como Full Stack. Esta Experiencia junto a mi inter\u00e9s en la Anal\u00edtica Web me ayud\u00f3 mucho entender el funcionamiento interno de las herramientas de anal\u00edtica, con las que vengo trabajo activamente desde 2017. Linkedin\",\"sameAs\":[\"http:\/\/luisrodriguez.pe\"],\"url\":\"https:\/\/luisrodriguez.pe\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Crear Helper en Codeigniter - Blog Luis Rodriguez","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/","og_locale":"es_ES","og_type":"article","og_title":"Crear Helper en Codeigniter - Blog Luis Rodriguez","og_description":"Los helper son basicamente funciones que nos ayudaran en el proceso del desarrollo que podemos llamar desde las vistas o controladores y no digo modelos por que no se deberia llamarlos desde hay. crearlas son sumamente facil es mas si es que tienes una funcion ya escrita en php simplemente la puedes copiar y comodolar[...]","og_url":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/","og_site_name":"Blog Luis Rodriguez","article_publisher":"https:\/\/www.facebook.com\/luisrodriguez.pe","article_published_time":"2015-03-17T21:05:46+00:00","og_image":[{"url":"http:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png","type":"","width":"","height":""}],"author":"Luis Rodriguez","twitter_card":"summary_large_image","twitter_creator":"@luizmirodriguez","twitter_site":"@luizmirodriguez","twitter_misc":{"Escrito por":"Luis Rodriguez","Tiempo de lectura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#article","isPartOf":{"@id":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/"},"author":{"name":"Luis Rodriguez","@id":"https:\/\/luisrodriguez.pe\/blog\/#\/schema\/person\/ec55de81e01fdaf3533eb78f6a49090c"},"headline":"Crear Helper en Codeigniter","datePublished":"2015-03-17T21:05:46+00:00","mainEntityOfPage":{"@id":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/"},"wordCount":310,"commentCount":0,"image":{"@id":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#primaryimage"},"thumbnailUrl":"http:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png","keywords":["codeigniter","funciones","helper","php"],"articleSection":["Desarrollo web","PHP"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/","url":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/","name":"Crear Helper en Codeigniter - Blog Luis Rodriguez","isPartOf":{"@id":"https:\/\/luisrodriguez.pe\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#primaryimage"},"image":{"@id":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#primaryimage"},"thumbnailUrl":"http:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png","datePublished":"2015-03-17T21:05:46+00:00","author":{"@id":"https:\/\/luisrodriguez.pe\/blog\/#\/schema\/person\/ec55de81e01fdaf3533eb78f6a49090c"},"breadcrumb":{"@id":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#primaryimage","url":"https:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png","contentUrl":"https:\/\/luisrodriguez.pe\/blog\/wp-content\/uploads\/2015\/03\/ubicacion_helper.png","width":243,"height":327},{"@type":"BreadcrumbList","@id":"https:\/\/luisrodriguez.pe\/blog\/crear-helper-en-codeigniter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/luisrodriguez.pe\/blog\/"},{"@type":"ListItem","position":2,"name":"Crear Helper en Codeigniter"}]},{"@type":"WebSite","@id":"https:\/\/luisrodriguez.pe\/blog\/#website","url":"https:\/\/luisrodriguez.pe\/blog\/","name":"Blog Luis Rodriguez","description":"Analytics Developer","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/luisrodriguez.pe\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Person","@id":"https:\/\/luisrodriguez.pe\/blog\/#\/schema\/person\/ec55de81e01fdaf3533eb78f6a49090c","name":"Luis Rodriguez","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/secure.gravatar.com\/avatar\/3b0f9734b267ecb38e1860734b4caebda4efa8be9a2bb536862b6a2ba23afa82?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3b0f9734b267ecb38e1860734b4caebda4efa8be9a2bb536862b6a2ba23afa82?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3b0f9734b267ecb38e1860734b4caebda4efa8be9a2bb536862b6a2ba23afa82?s=96&d=mm&r=g","caption":"Luis Rodriguez"},"description":"Hola, Soy Luis Rodriguez, radico en Lima \u2013 Per\u00fa, formado en una carrera inform\u00e1tica, desempe\u00f1ando desde el 2007 como programador web y viendo proyectos desde Front End y Back End a lo que me perfile como Full Stack. Esta Experiencia junto a mi inter\u00e9s en la Anal\u00edtica Web me ayud\u00f3 mucho entender el funcionamiento interno de las herramientas de anal\u00edtica, con las que vengo trabajo activamente desde 2017. Linkedin","sameAs":["http:\/\/luisrodriguez.pe"],"url":"https:\/\/luisrodriguez.pe\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/luisrodriguez.pe\/blog\/wp-json\/wp\/v2\/posts\/750","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/luisrodriguez.pe\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/luisrodriguez.pe\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/luisrodriguez.pe\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/luisrodriguez.pe\/blog\/wp-json\/wp\/v2\/comments?post=750"}],"version-history":[{"count":2,"href":"https:\/\/luisrodriguez.pe\/blog\/wp-json\/wp\/v2\/posts\/750\/revisions"}],"predecessor-version":[{"id":757,"href":"https:\/\/luisrodriguez.pe\/blog\/wp-json\/wp\/v2\/posts\/750\/revisions\/757"}],"wp:attachment":[{"href":"https:\/\/luisrodriguez.pe\/blog\/wp-json\/wp\/v2\/media?parent=750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/luisrodriguez.pe\/blog\/wp-json\/wp\/v2\/categories?post=750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/luisrodriguez.pe\/blog\/wp-json\/wp\/v2\/tags?post=750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}