<?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>へっぽこ開発室 &#187; Smarty</title>
	<atom:link href="http://wp.foliz.net/archives/tag/smarty/feed" rel="self" type="application/rss+xml" />
	<link>http://wp.foliz.net</link>
	<description>webプログラム　php,Smarty,Zend Framework,ajax,pearネタなど～</description>
	<lastBuildDate>Sat, 21 Jan 2012 06:32:52 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Smarty 出力フィルター</title>
		<link>http://wp.foliz.net/archives/66</link>
		<comments>http://wp.foliz.net/archives/66#comments</comments>
		<pubDate>Thu, 17 Jan 2008 10:29:43 +0000</pubDate>
		<dc:creator>Fou</dc:creator>
				<category><![CDATA[Smarty]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/archives/66</guid>
		<description><![CDATA[EUC-JPで作ったテンプレート出力をSHIFT-JISに変更する方法。 //プラグインの登録 $smarty-&#62;plugins_dir = array&#40;'plugins',APPLICATION_PATH [...]]]></description>
			<content:encoded><![CDATA[<p>EUC-JPで作ったテンプレート出力をSHIFT-JISに変更する方法。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//プラグインの登録</span>
<span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">plugins_dir</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'plugins'</span><span style="color: #339933;">,</span>APPLICATION_PATH<span style="color: #339933;">.</span><span style="color: #0000ff;">'/library/plugins/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//出力フィルターの設定</span>
<span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">autoload_filters</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;output&quot;</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;encode_euctosjis&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>outputfilter.encode_euctosjis.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> smarty_outputfilter_encode_euctosjis <span style="color: #009900;">&#40;</span><span style="color: #000088;">$buff</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$smarty</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$buff</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mb_convert_encoding</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$buff</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'SJIS'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'EUC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$buff</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>ただし！！<br />
$smarty->append()を使った場合はエンコードされたのを、display()でまたエンコードされてしまいうまくいかない。。</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/66/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smarty html_options でonchangeイベント</title>
		<link>http://wp.foliz.net/archives/56</link>
		<comments>http://wp.foliz.net/archives/56#comments</comments>
		<pubDate>Thu, 18 Oct 2007 03:33:24 +0000</pubDate>
		<dc:creator>Fou</dc:creator>
				<category><![CDATA[Smarty]]></category>
		<category><![CDATA[html_options]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/archives/56</guid>
		<description><![CDATA[ほんと今更ながらの話なのですが、SelectタグでonChangeイベントを使いたい場合{html_options}を使わずforeach文で書いていましたが、html_optionsで表現できるんですね。。 {html [...]]]></description>
			<content:encoded><![CDATA[<p>ほんと今更ながらの話なのですが、SelectタグでonChangeイベントを使いたい場合{html_options}を使わずforeach文で書いていましたが、html_optionsで表現できるんですね。。<br />
<span id="more-56"></span></p>
<p><code><br />
{html_options name="pref" options=$prefecture onchange="selectBox()"}<br />
</code><br />
そのまま何も考えず付けたい属性を追加すればいいだけです。<br />
・・・無知ってコワイですねｗ</p>
<p>ついでに以下のようなグループ別けして渡すと勝手にoptgroup属性を付けてくれる。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$prefecture</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
<span style="color: #cc66cc;">0</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;▼選択して下さい&quot;</span>
<span style="color: #0000ff;">&quot;北海道・東北&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">Array</span> <span style="color: #009900;">&#40;</span>
  <span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;北海道&quot;</span>
  <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;青森県&quot;</span>
  <span style="color: #cc66cc;">3</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;岩手県&quot;</span>
  <span style="color: #cc66cc;">4</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;宮城県&quot;</span>
  <span style="color: #cc66cc;">5</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;秋田県&quot;</span>
  <span style="color: #cc66cc;">6</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;山形県&quot;</span>
  <span style="color: #cc66cc;">7</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;福島県&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;関東&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">Array</span> <span style="color: #009900;">&#40;</span>
  <span style="color: #cc66cc;">8</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;茨城県&quot;</span>
  <span style="color: #cc66cc;">9</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;栃木県&quot;</span>
  <span style="color: #cc66cc;">10</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;群馬県&quot;</span>
  <span style="color: #cc66cc;">11</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;埼玉県&quot;</span>
  <span style="color: #cc66cc;">12</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;千葉県&quot;</span>
  <span style="color: #cc66cc;">13</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;東京都&quot;</span>
  <span style="color: #cc66cc;">14</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;神奈川県&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;甲信越・北陸&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">Array</span> <span style="color: #009900;">&#40;</span>
  <span style="color: #cc66cc;">15</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;新潟県&quot;</span>
  <span style="color: #cc66cc;">16</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;富山県&quot;</span>
  <span style="color: #cc66cc;">17</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;石川県&quot;</span>
  <span style="color: #cc66cc;">18</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;福井県&quot;</span>
  <span style="color: #cc66cc;">19</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;山梨県&quot;</span>
  <span style="color: #cc66cc;">20</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;長野県&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;東海&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">Array</span> <span style="color: #009900;">&#40;</span>
  <span style="color: #cc66cc;">21</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;岐阜県&quot;</span>
  <span style="color: #cc66cc;">22</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;静岡県&quot;</span>
  <span style="color: #cc66cc;">23</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;愛知県&quot;</span>
  <span style="color: #cc66cc;">24</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;三重県&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;近畿&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">Array</span> <span style="color: #009900;">&#40;</span>
  <span style="color: #cc66cc;">25</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;滋賀県&quot;</span>
  <span style="color: #cc66cc;">26</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;京都府&quot;</span>
  <span style="color: #cc66cc;">27</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;大阪府&quot;</span>
  <span style="color: #cc66cc;">28</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;兵庫県&quot;</span>
  <span style="color: #cc66cc;">29</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;奈良県&quot;</span>
  <span style="color: #cc66cc;">30</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;和歌山県&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;中国・四国&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">Array</span> <span style="color: #009900;">&#40;</span>
  <span style="color: #cc66cc;">31</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;鳥取県&quot;</span>
  <span style="color: #cc66cc;">32</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;島根県&quot;</span>
  <span style="color: #cc66cc;">33</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;岡山県&quot;</span>
  <span style="color: #cc66cc;">34</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;広島県&quot;</span>
  <span style="color: #cc66cc;">35</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;山口県&quot;</span>
  <span style="color: #cc66cc;">36</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;徳島県&quot;</span>
  <span style="color: #cc66cc;">37</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;香川県&quot;</span>
  <span style="color: #cc66cc;">38</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;愛媛県&quot;</span>
  <span style="color: #cc66cc;">39</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;高知県&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;九州・沖縄&quot;</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">Array</span> <span style="color: #009900;">&#40;</span>
  <span style="color: #cc66cc;">40</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;福岡県&quot;</span>
  <span style="color: #cc66cc;">41</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;佐賀県&quot;</span>
  <span style="color: #cc66cc;">42</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;長崎県&quot;</span>
  <span style="color: #cc66cc;">43</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;熊本県&quot;</span>
  <span style="color: #cc66cc;">44</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;大分県&quot;</span>
  <span style="color: #cc66cc;">45</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;宮崎県&quot;</span>
  <span style="color: #cc66cc;">46</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;鹿児島県&quot;</span>
  <span style="color: #cc66cc;">47</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">&quot;沖縄県&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span></pre></div></div>

<p>（debugウインドウから適当に編集したので間違いがあるかも）</p>
<p>↓<br />
結果</p>
<select name="pref">
<option label="▼選択して下さい" value="0">▼選択して下さい</option>
<p> <optgroup label="北海道・東北"></optgroup><br />
<option label="北海道" value="1">北海道</option>
<option label="青森県" value="2">青森県</option>
<option label="岩手県" value="3">岩手県</option>
<option label="宮城県" value="4">宮城県</option>
<option label="秋田県" value="5">秋田県</option>
<option label="山形県" value="6">山形県</option>
<option label="福島県" value="7">福島県</option>
<p> <optgroup label="関東"></optgroup><br />
<option label="茨城県" value="8">茨城県</option>
<option label="栃木県" value="9">栃木県</option>
<option label="群馬県" value="10">群馬県</option>
<option label="埼玉県" value="11">埼玉県</option>
<option label="千葉県" value="12">千葉県</option>
<option label="東京都" value="13">東京都</option>
<option label="神奈川県" value="14">神奈川県</option>
<p> <optgroup label="甲信越・北陸"></optgroup><br />
<option label="新潟県" value="15">新潟県</option>
<option label="富山県" value="16">富山県</option>
<option label="石川県" value="17">石川県</option>
<option label="福井県" value="18">福井県</option>
<option label="山梨県" value="19">山梨県</option>
<option label="長野県" value="20">長野県</option>
<p> <optgroup label="東海"></optgroup><br />
<option label="岐阜県" value="21">岐阜県</option>
<option label="静岡県" value="22">静岡県</option>
<option label="愛知県" value="23">愛知県</option>
<option label="三重県" value="24">三重県</option>
<p> <optgroup label="近畿"></optgroup><br />
<option label="滋賀県" value="25">滋賀県</option>
<option label="京都府" value="26">京都府</option>
<option label="大阪府" value="27">大阪府</option>
<option label="兵庫県" value="28">兵庫県</option>
<option label="奈良県" value="29">奈良県</option>
<option label="和歌山県" value="30">和歌山県</option>
<p> <optgroup label="中国・四国"></optgroup><br />
<option label="鳥取県" value="31">鳥取県</option>
<option label="島根県" value="32">島根県</option>
<option label="岡山県" value="33">岡山県</option>
<option label="広島県" value="34">広島県</option>
<option label="山口県" value="35">山口県</option>
<option label="徳島県" value="36">徳島県</option>
<option label="香川県" value="37">香川県</option>
<option label="愛媛県" value="38">愛媛県</option>
<option label="高知県" value="39">高知県</option>
<p> <optgroup label="九州・沖縄"></optgroup><br />
<option label="福岡県" value="40">福岡県</option>
<option label="佐賀県" value="41">佐賀県</option>
<option label="長崎県" value="42">長崎県</option>
<option label="熊本県" value="43">熊本県</option>
<option label="大分県" value="44">大分県</option>
<option label="宮崎県" value="45">宮崎県</option>
<option label="鹿児島県" value="46">鹿児島県</option>
<option label="沖縄県" value="47">沖縄県</option>
</select>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/56/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smarty Splitプラグイン</title>
		<link>http://wp.foliz.net/archives/30</link>
		<comments>http://wp.foliz.net/archives/30#comments</comments>
		<pubDate>Thu, 06 Sep 2007 10:59:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Smarty]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/archives/30</guid>
		<description><![CDATA[前回の http://smarty.incutio.com/にある　便利そうな　Block Functions　SplitとSplit_rowプラグインを試した。 　 split &#8211; Loop structu [...]]]></description>
			<content:encoded><![CDATA[<p>前回の<a alt="http://smarty.incutio.com/" href="http://smarty.incutio.com/"><br />
http://smarty.incutio.com/</a>にある　便利そうな　<strong>Block Functions</strong>　SplitとSplit_rowプラグインを試した。</p>
<ul>　</p>
<li><a href="http://smarty.incutio.com/?page=split">split</a> &#8211; Loop structure similar to foreach that breaks an array into groups as evenly as possible then iterates over those groups. Intended to allow multi column layouts with a minimum of markup in the template code.</li>
<li><a href="http://smarty.incutio.com/?page=split_row">split_row</a> &#8211; A variant of split that returns the chunks as rows instead of as columns</li>
</ul>
<p>それぞれ　block.split.php　block.split_row.php ファイルを作りプラグインフォルダに放り込む。<br />
さて、普通ならここで使えるのだが、</p>
<blockquote><p><code>Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in <em>略</em>/block.split.php on line 104<br />
</code></p></blockquote>
<p>こんなエラーが。。</p>
<p>調べてみると、どうやら参照渡しのやり方が非推進の方法でやられてるらしい。<br />
<a href="http://php.net/manual/ja/ini.core.php">http://php.net/manual/ja/ini.core.php</a></p>
<p>なんとか使えるように修正しようとしたがよくわからず挫折しました＾＾；<br />
allow_call_time_pass_referenceの設定を1のまま使えるようにした方がいたら教えて下さい＞＜</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/30/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

