<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jorgelig Blog &#187; Yii</title>
	<atom:link href="http://www.jorgelig.com/category/yii/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jorgelig.com</link>
	<description>Jorgelig Blog, mi lado Friki al natural...</description>
	<lastBuildDate>Tue, 17 Jan 2012 17:13:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://www.jorgelig.com/?pushpress=hub'/>
		<item>
		<title>Gmap, extensión de Google Maps para Yii</title>
		<link>http://www.jorgelig.com/2010/10/03/gmap-extension-de-google-maps-para-yii/</link>
		<comments>http://www.jorgelig.com/2010/10/03/gmap-extension-de-google-maps-para-yii/#comments</comments>
		<pubDate>Sun, 03 Oct 2010 08:59:48 +0000</pubDate>
		<dc:creator>Jorgelig</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[WebTip]]></category>
		<category><![CDATA[Yii]]></category>
		<category><![CDATA[Extensión]]></category>
		<category><![CDATA[gmap]]></category>
		<category><![CDATA[Google maps]]></category>

		<guid isPermaLink="false">http://www.jorgelig.com/?p=820</guid>
		<description><![CDATA[gmap una extensión para Yii que nos permite usar en la pagina un mapa de Google Maps


No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><p>gmap es una extensión para Yii que nos permite incrustar un mapa de &#8220;Google maps&#8221; fácilmente, es cosa de pasarle como parametro la direccio, ciudad, estado y pais.</p>
<p><strong>Requisitos</strong>:</p>
<ul>
<li>Yii 1.0 o superior</li>
</ul>
<p><strong> Instalación </strong></p>
<ul>
<li>Descargar el archivo <a href="http://www.yiiframework.com/extension/gmap/files/gmap.zip">zip</a></li>
<li>Descomprimirlo en la carpeta &#8220;protected/extensions/gmap&#8221;</li>
</ul>
<p><strong>Uso</strong></p>
<ul>
<li>Agregar este código en la parte donde se quiera mostrar el mapa:</li>
<p><BR /></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widget</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'application.extensions.gmap.GMap'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'gmap'</span><span style="color: #339933;">,</span><span style="color: #666666; font-style: italic;">//id del contenedor &lt;div&gt;.</span>
    <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'xxx'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//Para obtener una key, debes registrarte aqui: http://code.google.com/intl/es-419/apis/maps/signup.html</span>
    <span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'nombre_lugar'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//este texto aparecerá en el logo de dialogo señalando el punto</span>
    <span style="color: #0000ff;">'address'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'address'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'yyyy'</span><span style="color: #339933;">,</span><span style="color: #666666; font-style: italic;">//Introducir la direccion del lugar, pe: 'Santa María 200,Rincón de Santa María'</span>
        <span style="color: #0000ff;">'city'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'zzzzz'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">//Nombre de la ciudad, pe: Monterrey</span>
        <span style="color: #0000ff;">'state'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'aaaaa'</span><span style="color: #666666; font-style: italic;">//Estado, pe: Nuevo Leon</span>
        <span style="color: #666666; font-style: italic;">//'country' =&gt; 'bbbbbb' //Pais</span>
        <span style="color: #666666; font-style: italic;">//'zip' =&gt; 'XXXXX' - //Codigo Postal</span>
        <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</ul>
<p><strong> Personalización </strong></p>
<ul>
<li>Cambiar tamaño: Modificar el archivo gmap.css que se encuentra en &#8220;protected/extensions/gmap/css/&#8221;</li>
<li>Añadir controles: Modificar la función &#8220;ShowMap&#8221; del archivo gmap.js que se encuentra en, quedando de la siguiente manera:</li>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	showMap<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>point<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>typeof this<span style="color: #339933;">.</span>map <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'object'</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			this<span style="color: #339933;">.</span>map <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GMap2<span style="color: #009900;">&#40;</span>document<span style="color: #339933;">.</span>getElementById<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>id<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		this<span style="color: #339933;">.</span>map<span style="color: #339933;">.</span>addControl<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> GSmallMapControl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Linea agregada: controles de zoom</span>
		this<span style="color: #339933;">.</span>map<span style="color: #339933;">.</span>addControl<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> GMapTypeControl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Linea agregada: controles para tipo de mapa</span>
		this<span style="color: #339933;">.</span>map<span style="color: #339933;">.</span>setCenter<span style="color: #009900;">&#40;</span>point<span style="color: #339933;">,</span> <span style="color: #cc66cc;">14</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>typeof this<span style="color: #339933;">.</span>marker <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;object&quot;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			this<span style="color: #339933;">.</span>marker <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GMarker<span style="color: #009900;">&#40;</span>point<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			this<span style="color: #339933;">.</span>map<span style="color: #339933;">.</span>addOverlay<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>marker<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			this<span style="color: #339933;">.</span>marker<span style="color: #339933;">.</span>openInfoWindowHtml<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>label<span style="color: #339933;">||</span>this<span style="color: #339933;">.</span>address<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			this<span style="color: #339933;">.</span>marker<span style="color: #339933;">.</span>setLatLng<span style="color: #009900;">&#40;</span>point<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			this<span style="color: #339933;">.</span>marker<span style="color: #339933;">.</span>openInfoWindowHtml<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>label<span style="color: #339933;">||</span>this<span style="color: #339933;">.</span>address<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

</ul>
</div>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jorgelig.com/2010/10/03/gmap-extension-de-google-maps-para-yii/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP Error: A non well formed numeric value encountered</title>
		<link>http://www.jorgelig.com/2010/06/27/php-error-a-non-well-formed-numeric-value-encountered/</link>
		<comments>http://www.jorgelig.com/2010/06/27/php-error-a-non-well-formed-numeric-value-encountered/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 00:00:15 +0000</pubDate>
		<dc:creator>Jorgelig</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Yii]]></category>

		<guid isPermaLink="false">http://www.jorgelig.com/?p=803</guid>
		<description><![CDATA[Solución al Error "A non well formed numeric value encountered" en PHP 5.3.2 y usando el Framework Yii 1.1.2


No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><p>Este error me salio usando PHP 5.3.2 y Framework Yii 1.1.2 en la siguiente linea de mi view:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'value'</span><span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'date(&quot;d-m-Y H:i:s&quot;,$data-&gt;fecha_inicio)'</span><span style="color: #339933;">,</span></pre></div></div>

<p>y para solucionarlo hay que usar la funcion strtotime de php, quedando aso:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'value'</span><span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'date(&quot;d-m-Y H:i:s&quot;,strtotime($data-&gt;fecha_fin))'</span><span style="color: #339933;">,</span></pre></div></div>

<p>Si no tienes configurado el &#8220;timeZone&#8221; en Yii te saldrá un error parecido a este:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> It is not safe to rely on the <span style="color: #990000;">system</span><span style="color: #0000ff;">'s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected '</span>America<span style="color: #339933;">/</span>Chicago<span style="color: #0000ff;">' for '</span>CDT<span style="color: #339933;">/-</span><span style="color:#800080;">5.0</span><span style="color: #339933;">/</span>DST<span style="color: #0000ff;">' instead</span></pre></div></div>

<p>Para configurar el &#8220;timeZone&#8221; debes ir a tu archivo de configuracion de tu proyecto Yii [protected/config/main.php], debe quedar algo asi:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'timeZone'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">&quot;America/Monterrey&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'basePath'</span><span style="color: #339933;">=&gt;</span>dirname<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #009900; font-weight: bold;">DIRECTORY_SEPARATOR</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'..'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'name'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Cultura UM'</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p>Recuerda usar la funcion strtotime en cada view donde requieras mostrar la fecha.</p>
</div>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jorgelig.com/2010/06/27/php-error-a-non-well-formed-numeric-value-encountered/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

