<?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>へっぽこ開発室</title>
	<atom:link href="http://wp.foliz.net/feed" rel="self" type="application/rss+xml" />
	<link>http://wp.foliz.net</link>
	<description>webプログラム　php,smarty,zend,ajax,pearネタなど～</description>
	<lastBuildDate>Thu, 02 Sep 2010 09:11:34 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>フラッシュマーケティングのまとめ</title>
		<link>http://wp.foliz.net/archives/311</link>
		<comments>http://wp.foliz.net/archives/311#comments</comments>
		<pubDate>Thu, 02 Sep 2010 09:11:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[webサービス]]></category>
		<category><![CDATA[フラッシュマーケティング]]></category>
		<category><![CDATA[共同購入割引サービス]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=311</guid>
		<description><![CDATA[最近流行のフラッシュマーケティング。
社内でも話題がチラホラ。
まずは「フラッシュマーケティング」の説明から。

ソーシャルメディアなどを活用して、共同購入をさせる。
ユーザーは欲しい商品があると、落札決定人数に達するま [...]]]></description>
			<content:encoded><![CDATA[<p>最近流行のフラッシュマーケティング。<br />
社内でも話題がチラホラ。</p>
<p>まずは「フラッシュマーケティング」の説明から。<br />
<span id="more-311"></span><br />
ソーシャルメディアなどを活用して、共同購入をさせる。<br />
ユーザーは欲しい商品があると、落札決定人数に達するまで<br />
自らが宣伝Twitterなどで宣伝するので波及力がある。</p>
<p>アメリカの「Groupon（グルーポン）」社が、この手法の共同購入割引サービスを開始したところ、１年で黒字化、2年足らずで300億円以上の売上を達成したことで注目を集め、<br />
今年に入ってこぞってサイトが立ち上がってる。</p>
<p>調べるといっぱいあるので、暇なときにでも追加していくとするか。</p>

<a href='http://wp.foliz.net/archives/311/%e6%9c%ac%e6%97%a5%e3%81%ae%e3%83%81%e3%82%b1%e3%83%83%e3%83%88-%e3%82%b0%e3%83%9f%e3%83%81%e3%82%b1-%e6%9d%b1%e4%ba%ac-%ef%bd%9e-%e3%81%8a%e4%bb%95%e4%ba%8b%e5%b8%b0%e3%82%8a%e3%81%ab%e6%89%8b' title='グミチケ'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/322885c74c84d395ffff347c5b9b017c-150x150.png" class="attachment-thumbnail" alt="グミチケ" title="グミチケ" /></a>
<a href='http://wp.foliz.net/archives/311/%e3%82%a4%e3%82%a4%e5%80%a4%e3%83%83%e3%82%b0%e3%83%ab%e3%83%a1-%e3%81%8a%e5%be%97%e3%81%aa%e3%83%81%e3%82%b1%e3%83%83%e3%83%88%e6%83%85%e5%a0%b1%e6%af%8e%e6%97%a5%e6%97%a5%e6%9b%bf%e3%82%8f' title='イイ値ッ!グルメ - お得なチケット情報毎日日替わりで'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/20bb039293210eb5928da1f58ea0465d-150x150.png" class="attachment-thumbnail" alt="イイ値ッ!グルメ" title="イイ値ッ!グルメ - お得なチケット情報毎日日替わりで" /></a>
<a href='http://wp.foliz.net/archives/311/1%e6%b3%8a109%e5%86%86%ef%bd%9e%e3%80%81%e6%97%85%e9%a4%a8%e3%83%9b%e3%83%86%e3%83%ab%e3%80%81%e7%9b%b4%e5%89%8d%e4%ba%88%e7%b4%84%e3%81%aa%e3%82%89%e4%bc%9a%e5%93%a1%e5%88%b6%e3%81%ae%e3%83%88' title='1泊109円～、旅館ホテル、直前予約なら会員制のトクー！'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/ca9568b9992d4a8cc68cd912c8ccfb6b-150x150.png" class="attachment-thumbnail" alt="トクー！トラベル" title="1泊109円～、旅館ホテル、直前予約なら会員制のトクー！" /></a>
<a href='http://wp.foliz.net/archives/311/shareee-%e3%81%bf%e3%82%93%e3%81%aa%e3%81%a7%e4%bd%bf%e3%81%8a%e3%81%86%e3%80%81%e3%81%8a%e5%be%97%e3%81%aa%e3%82%af%e3%83%bc%e3%83%9d%e3%83%b3%ef%bc%81%ef%bc%81%ef%bc%81' title='Shareee - みんなで使おう、お得なクーポン！！！'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/8640ee0ecb0fef4027b2a865f62d753b-150x150.png" class="attachment-thumbnail" alt="Shareee" title="Shareee - みんなで使おう、お得なクーポン！！！" /></a>
<a href='http://wp.foliz.net/archives/311/%e3%83%8a%e3%82%b4%e3%81%bd%e3%82%93%e3%81%af%e5%90%8d%e5%8f%a4%e5%b1%8b%e3%81%ae%e3%81%8a%e5%be%97%e3%81%aa%e3%82%af%e3%83%bc%e3%83%9d%e3%83%b3%e3%82%b5%e3%82%a4%e3%83%88%ef%bd%9c%e6%84%9b%e7%9f%a5' title='ナゴぽんは名古屋のお得なクーポンサイト｜愛知、名古屋'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/b63c486e720a186836ff1edd25c24bd0-150x150.png" class="attachment-thumbnail" alt="ナゴぽん" title="ナゴぽんは名古屋のお得なクーポンサイト｜愛知、名古屋" /></a>
<a href='http://wp.foliz.net/archives/311/goti-%e3%83%97%e3%83%ac%e3%83%9f%e3%82%a2%e3%83%a0%e3%83%81%e3%82%b1%e3%83%83%e3%83%88-%e3%82%b4%e3%83%bc%e3%83%81%e3%81%af%e3%82%b0%e3%83%ab%e3%83%a1%e3%83%bb%e3%82%b7%e3%83%a7%e3%83%83%e3%83%94' title='GOTi プレミアムチケット  ゴーチはグルメ・ショッピング・エステなど特別チケットをご提供'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/8654d78b6f95aff6a4b6263bebea38f7-150x150.png" class="attachment-thumbnail" alt="GOTi プレミアムチケット" title="GOTi プレミアムチケット  ゴーチはグルメ・ショッピング・エステなど特別チケットをご提供" /></a>
<a href='http://wp.foliz.net/archives/311/%e3%82%b0%e3%83%ab%e3%83%94-%e3%81%bf%e3%82%93%e3%81%aa%e3%81%a7%e8%b3%bc%e5%85%a5%e3%81%99%e3%82%8b%e3%83%97%e3%83%ac%e3%83%9f%e3%82%a2%e3%83%a0%e3%83%81%e3%82%b1%e3%83%83%e3%83%88' title='グルピ みんなで購入するプレミアムチケット'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/ae9edb774314c75825db312657cdeb34-150x150.png" class="attachment-thumbnail" alt="グルピ" title="グルピ みんなで購入するプレミアムチケット" /></a>
<a href='http://wp.foliz.net/archives/311/pita-ticket%e3%83%94%e3%82%bf%e3%83%81%e3%82%b1%e3%83%83%e3%83%88%e3%80%8c%e3%81%bf%e3%82%93%e3%81%aa%e3%81%a7%e8%b2%b7%e3%81%88%e3%82%8b%e3%80%81%e7%89%b9%e5%88%a5%e3%81%aa%e6%97%a5%e3%80%82' title='Pita Ticket[ピタチケット]「みんなで買える、特別な日。」 - 東京エリアの本日のクーポン'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/60dc50fcfc25dddee2b30c3b6a46f469-150x150.png" class="attachment-thumbnail" alt="Pita Ticket[ピタチケット]" title="Pita Ticket[ピタチケット]「みんなで買える、特別な日。」 - 東京エリアの本日のクーポン" /></a>
<a href='http://wp.foliz.net/archives/311/groupmall-%e3%81%bf%e3%82%93%e3%81%aa%e3%81%a7%e5%be%97%e3%81%99%e3%82%8b%e3%82%b0%e3%83%ab%e3%83%bc%e3%83%97%e3%82%b7%e3%83%a7%e3%83%83%e3%83%94%e3%83%b3%e3%82%b0%ef%bc%81%e6%97%a5%e6%9b%bf' title='GroupMall - みんなで得するグループショッピング！日替わりで割引クーポン販売！'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/3e51110bc883bc48c46f90374aedf2b8-150x150.png" class="attachment-thumbnail" alt="GroupMall" title="GroupMall - みんなで得するグループショッピング！日替わりで割引クーポン販売！" /></a>
<a href='http://wp.foliz.net/archives/311/%e3%82%b0%e3%83%ab%e3%83%bc%e3%83%9d%e3%83%b3%e3%81%aa%e3%81%86-%e3%82%b0%e3%83%ab%e3%83%bc%e3%83%9d%e3%83%b3%e7%b3%bb%e5%85%b1%e5%90%8c%e8%b3%bc%e5%85%a5%e3%82%af%e3%83%bc%e3%83%9d%e3%83%b3' title='グルーポンなう - グルーポン系共同購入クーポン情報まとめサイト'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/b6f76617393381864f4625ed7b455dee-150x150.png" class="attachment-thumbnail" alt="グルーポンなう" title="グルーポンなう - グルーポン系共同購入クーポン情報まとめサイト" /></a>
<a href='http://wp.foliz.net/archives/311/%e6%97%a5%e6%9c%ac%e5%88%9d%e3%80%81%e6%97%a5%e6%9b%bf%e3%82%8a%e3%82%af%e3%83%bc%e3%83%9d%e3%83%b3%e3%82%b5%e3%82%a4%e3%83%88%e3%80%8cpiku%ef%bc%88%e3%83%94%e3%82%af%ef%bc%89%e3%80%8d' title='日本初、日替りクーポンサイト「Piku（ピク）」'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/7342419f132e0c76f6fa527c137d9aac-150x150.png" class="attachment-thumbnail" alt="日本初、日替りクーポンサイト「Piku（ピク）」" title="日本初、日替りクーポンサイト「Piku（ピク）」" /></a>
<a href='http://wp.foliz.net/archives/311/%e3%81%84%e3%81%84%e3%83%a2%e3%83%8e%e3%80%81%e6%a5%bd%e3%81%97%e3%81%84%e3%82%b3%e3%83%88%e3%80%81%e8%a6%8b%e3%81%a4%e3%81%8b%e3%82%8b-%e3%83%9d%e3%83%b3%e3%83%91%e3%83%ac%e3%83%bc%e3%83%89-pomparade' title='いいモノ、楽しいコト、見つかる ポンパレード Pomparade　東京版'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/0c66fd5705a9679bff326e47541b2d51-150x150.png" class="attachment-thumbnail" alt="Pomparade　東京版" title="いいモノ、楽しいコト、見つかる ポンパレード Pomparade　東京版" /></a>
<a href='http://wp.foliz.net/archives/311/coopa%e3%80%90%e3%82%af%e3%83%bc%e3%83%91%e3%80%91%e3%81%93%e3%81%93%e3%81%a0%e3%81%91%e3%81%ae%e3%82%af%e3%83%bc%e3%83%9d%e3%83%b3%e3%83%81%e3%82%b1%e3%83%83%e3%83%88%e3%82%92%e3%81%bf%e3%82%93' title='CooPa【クーパ】ここだけのクーポンチケットをみんなでお得に共同購入'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/9822fc715e974f2f72097d1575d1e55c-150x150.png" class="attachment-thumbnail" alt="CooPa【クーパ】" title="CooPa【クーパ】ここだけのクーポンチケットをみんなでお得に共同購入" /></a>
<a href='http://wp.foliz.net/archives/311/qpod%e3%82%af%e3%83%bc%e3%83%9d%e3%83%83%e3%83%89-by-groupon-%e9%b9%bf%e5%85%90%e5%b3%b6%e7%94%a3%e9%bb%92%e8%b1%9a%e3%81%97%e3%82%83%e3%81%b6%e3%81%97%e3%82%83%e3%81%b6%e3%81%8c%e3%80%81%e3%81%aa' title='Qpod(クーポッド) by GROUPON'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/8be42313db7f3da53ce7f665d472751b-150x150.png" class="attachment-thumbnail" alt="Qpod(クーポッド)" title="Qpod(クーポッド) by GROUPON" /></a>
<a href='http://wp.foliz.net/archives/311/qpon%e3%80%90%e3%82%ad%e3%83%a5%e3%83%bc%e3%83%9d%e3%83%b3%e3%80%91%e3%81%8a%e5%be%97%e3%81%af%e3%81%bf%e3%82%93%e3%81%aa%e3%81%a7%e3%81%a4%e3%81%8f%e3%82%8b%e3%80%82%e3%82%ae%e3%83%a3%e3%82%b6-2' title='Qpon【キューポン】お得はみんなでつくる。ギャザリング®クーポンサイト'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/902d77177f411c0da55b3b72aee266161-150x150.png" class="attachment-thumbnail" alt="Qpon【キューポン】" title="Qpon【キューポン】お得はみんなでつくる。ギャザリング®クーポンサイト" /></a>
<a href='http://wp.foliz.net/archives/311/%e3%81%a1%e3%82%87%e3%81%a3%e3%81%a8%e3%82%aa%e3%82%bf%e3%82%af%e3%81%aa%e3%83%97%e3%83%ac%e3%83%9f%e3%82%a2%e3%83%a0%e3%82%af%e3%83%bc%e3%83%9d%e3%83%b3%e3%82%b5%e3%82%a4%e3%83%88-%e3%83%b2%e3%82%bf' title='ちょっとオタクなプレミアムクーポンサイト  ヲタぽん'><img width="150" height="150" src="http://wp.foliz.net/wp-content/uploads/2010/09/0494f3d058870541dce12d491c49eb8a-150x150.png" class="attachment-thumbnail" alt="ヲタぽん" title="ちょっとオタクなプレミアムクーポンサイト  ヲタぽん" /></a>

]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/311/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Form DLタグの外に送信ボタンを置く</title>
		<link>http://wp.foliz.net/archives/304</link>
		<comments>http://wp.foliz.net/archives/304#comments</comments>
		<pubDate>Wed, 21 Jul 2010 15:11:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[Zend_Form]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=304</guid>
		<description><![CDATA[Zend_Formを使ったページで
DLタグの外にボタンを置いてほしいと要望があったので
設置メモ

DisplayGroupを使ってDLを一つのグループ、
ボタンを未属性のグループとして表現した。
$formには送信ボ [...]]]></description>
			<content:encoded><![CDATA[<p>Zend_Formを使ったページで<br />
DLタグの外にボタンを置いてほしいと要望があったので<br />
設置メモ<br />
<span id="more-304"></span></p>
<p>DisplayGroupを使ってDLを一つのグループ、<br />
ボタンを未属性のグループとして表現した。</p>
<p>$formには送信ボタン以外のエレメントが設定されていると仮定。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$elem</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$group</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$elem</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addDisplayGroup</span><span style="color: #009900;">&#40;</span>
    <span style="color: #000088;">$group</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'group'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElement</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'button'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'_checkButton'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'label'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'送信確認'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'type'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'submit'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setElementFilters</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'StringTrim'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'StripTags'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDescription</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;span class=&quot;required&quot;&gt;&amp;nbsp;&lt;/strong&gt; は必須項目です。'</span><span style="color: #009900;">&#41;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">//デザイン</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDecorators</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'FormElements'</span><span style="color: #339933;">,</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'decorator'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Description'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'options'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'p'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'description'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'escape'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'decorator'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'HtmlTag'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'div'</span> <span style="color: #339933;">,</span><span style="color: #0000ff;">'options'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'zend_form'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'Form'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDisplayGroupDecorators</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'FormElements'</span><span style="color: #339933;">,</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'dl'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'Fieldset'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setElementDecorators</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'ViewHelper'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'Errors'</span><span style="color: #339933;">,</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Description'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'p'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HtmlTag'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'dd'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Label'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'options'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tag'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'dt'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'requiredSuffix'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'&lt;span style=&quot;color:red&quot;&gt;（※）&lt;/span&gt;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'escape'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span>_checkButton<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDecorators</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
       <span style="color: #0000ff;">'ViewHelper'</span><span style="color: #339933;">,</span>
       <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'decorator'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'HtmlTag'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'options'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'divSubmit'</span><span style="color: #009900;">&#41;</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>以下結果</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">enctype</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-www-form-urlencoded&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;zend_form&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">fieldset</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fieldset-group&quot;</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dl</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dt</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;***&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;optional&quot;</span>&gt;</span>***<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dt</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dd</span>&gt;</span>$formエレメント要素<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dd</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dl</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;divSubmit&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">button</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;_checkButton&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;_checkButton&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span>&gt;</span>送信確認<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">button</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;description&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;required&quot;</span>&gt;</span><span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">strong</span>&gt;</span> は必須項目です。
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/304/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Application_Bootstrapの設定を取得</title>
		<link>http://wp.foliz.net/archives/298</link>
		<comments>http://wp.foliz.net/archives/298#comments</comments>
		<pubDate>Fri, 04 Jun 2010 06:55:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[Zend_Application_Bootstrap]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=298</guid>
		<description><![CDATA[Zend_Application_Bootstrap内の各_initでreturnされた設定を取得する方法。

例えば

class Bootstrap extends Zend_Application_Bootstra [...]]]></description>
			<content:encoded><![CDATA[<p>Zend_Application_Bootstrap内の各_initでreturnされた設定を取得する方法。</p>
<p><span id="more-298"></span><br />
例えば</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Bootstrap <span style="color: #000000; font-weight: bold;">extends</span> Zend_Application_Bootstrap_Bootstrap
<span style="color: #009900;">&#123;</span>
    protected <span style="color: #000000; font-weight: bold;">function</span> _initProfiler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$profiler</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Db_Profiler_Firebug<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'All DB Queries'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$profiler</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setEnabled</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setProfiler</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$profiler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$profiler</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>とした場合、controllerでも取り出したい場合が多々ある。<br />
そんな時は<br />
Controller内なら</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$Profiler</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getInvokeArg</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bootstrap'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResource</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Profiler'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>ViewやDbなどは特別で取得できるっぽい。</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/298/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>プロジェクト管理「Collabtive」を使ってみる</title>
		<link>http://wp.foliz.net/archives/295</link>
		<comments>http://wp.foliz.net/archives/295#comments</comments>
		<pubDate>Tue, 13 Apr 2010 13:35:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[Collabtive]]></category>
		<category><![CDATA[オープンソース]]></category>
		<category><![CDATA[プロジェクト管理]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=295</guid>
		<description><![CDATA[そろそろー
プロジェクト管理とバージョン管理を取り入れなきゃと想いながら
いまいち掴めないのずっと放置してましたが、
とりあえず一つインストールしてみた。

まずはプロジェクト管理をいろいろ探し回った結果、
シンプルで  [...]]]></description>
			<content:encoded><![CDATA[<p>そろそろー<br />
プロジェクト管理とバージョン管理を取り入れなきゃと想いながら<br />
いまいち掴めないのずっと放置してましたが、<br />
とりあえず一つインストールしてみた。<br />
<span id="more-295"></span><br />
まずはプロジェクト管理をいろいろ探し回った結果、<br />
シンプルで 使いやすそうなオープンソースで「<a href="http://collabtive.o-dyn.de/">Collabtive</a>」をインストールしてみた。<br />
Smarty+php+mysqlってことでとりあえずは触りやすいだろう。</p>
<p>インストールまでは何の問題もなく日本語がきちんと表示されていたけど<br />
入力データーが化けてしまうので、ちょっと反則だけどちょっと改造しちゃいました。</p>
<p>/include/class.datenbank.php 42行目</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000088;">$conn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_host</span><span style="color: #339933;">,</span><span style="color: #000088;">$db_user</span><span style="color: #339933;">,</span><span style="color: #000088;">$db_pass</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$db_check</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_check</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SET NAMES utf8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//追加</span>
            <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></div></div>

<p>とっても気に入らない対処法だが、ま、動けばよいだろう。</p>
<p><strong>Collabtive</strong><br />
<a href="http://collabtive.o-dyn.de/">http://collabtive.o-dyn.de/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/295/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chain of Responsibility</title>
		<link>http://wp.foliz.net/archives/288</link>
		<comments>http://wp.foliz.net/archives/288#comments</comments>
		<pubDate>Thu, 04 Mar 2010 08:16:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=288</guid>
		<description><![CDATA[ZendFramewrokで普通に使われているクラスのチェイン。
アレ覚えたい。
デザインパターンでChain of Responsibilityと言うらしい。

とりあえずここが参考になりそう
http://phpc2 [...]]]></description>
			<content:encoded><![CDATA[<p>ZendFramewrokで普通に使われているクラスのチェイン。<br />
アレ覚えたい。</p>
<p>デザインパターンで<strong>Chain of Responsibility</strong>と言うらしい。<br />
<span id="more-288"></span><br />
とりあえずここが参考になりそう<br />
<a href="http://phpc2.seesaa.net/">http://phpc2.seesaa.net/</a><br />
<a href="http://www.objective-php.net/blog/detail/20100113">http://www.objective-php.net/blog/detail/20100113</a></p>
<p>今日はここまでで勘弁してやろうか・・。</p>
<p>2010/03/06 リンク追加</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/288/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript ループ中にイベントリスナーを登録する最も簡単な方法</title>
		<link>http://wp.foliz.net/archives/278</link>
		<comments>http://wp.foliz.net/archives/278#comments</comments>
		<pubDate>Sat, 27 Feb 2010 16:45:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[イベントリスナー]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=278</guid>
		<description><![CDATA[今回はJavaScriptネタです。
こっち系はほとんど素人でぜんぜん得意ではありませんが、自分なりに考えてとってもナイスな方法を披露しちゃいます。

例えばこんな単純な処理
ちょっと文法があっているかどうかはわからんが [...]]]></description>
			<content:encoded><![CDATA[<p>今回はJavaScriptネタです。<br />
こっち系はほとんど素人でぜんぜん得意ではありませんが、自分なりに考えてとってもナイスな方法を披露しちゃいます。<br />
<span id="more-278"></span></p>
<p>例えばこんな単純な処理<br />
ちょっと文法があっているかどうかはわからんがこんなイメージ。</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hoge&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>ここに動的に要素を足して、足された文字をクリックでその文字がアラートされる</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> Kudamono <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;りんご&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;いちご&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;ばなな&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> ulElem <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'hoge'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> Kudamono.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> liElem <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> Kudamono<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">onclick</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>Kudamono<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
&nbsp;
 ulElem.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>liElem<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>意図とすればリストタグが3つ追加され、<br />
クリックするとアラートでその名前が表示されて欲しい。</p>
<p>だけど実際動かしてみると、全部最後の要素またはundefinedになる。<br />
まったくもって意図した動作ではなくなる。</p>
<p>これは定義したときに動作がきまるのではなくて、動かしたときの変数が有効になるため。<br />
クリックされたときは既にiが最後の値まで達しているのでそれを参照してしまうらしい。</p>
<p>そこでどんな回避策があるかといろいろ調べてみた。<br />
<a href="http://d.hatena.ne.jp/hi_c_mayu/20090704/1246641410">http://d.hatena.ne.jp/hi_c_mayu/20090704/1246641410</a><br />
<a href="http://labs.unoh.net/2006/05/post_11.html">http://labs.unoh.net/2006/05/post_11.html</a><br />
<a href="http://cesare.seesaa.net/article/18007870.html">http://cesare.seesaa.net/article/18007870.html</a></p>
<p>うーーん。。どれも素人の俺には使いにくい・・・。<br />
そこでfunctionやパラメータを使うのではなく要素自身のなんらかの値を使ってしまうのがもっとも見やすくて簡単だと思った。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> Kudamono <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;りんご&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;いちご&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;ばなな&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> ulElem <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'hoge'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> Kudamono.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> liElem <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> Kudamono<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">onclick</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">innerHTML</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  ulElem.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>liElem<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>innerHTMLと値を明らかに変えたい場合は</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">  liElem.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> i <span style="color: #339933;">+</span> <span style="color: #3366CC;">'番目の要素 '</span> <span style="color: #339933;">+</span>Kudamono<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'って美味しいよねー'</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">title</span> <span style="color: #339933;">=</span> Kudamono<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">onclick</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  ulElem.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>liElem<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>ってな感じはどーだろうか。<br />
自分ではナイスアイディアだと思うが（笑）</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/278/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>preg_replace_callback 名前付キャプチャ</title>
		<link>http://wp.foliz.net/archives/273</link>
		<comments>http://wp.foliz.net/archives/273#comments</comments>
		<pubDate>Thu, 25 Feb 2010 13:52:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[preg_replace_callback]]></category>
		<category><![CDATA[正規表現]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=273</guid>
		<description><![CDATA[正規表現に名前付キャプチャ（名前付き捕獲式集合と言うらしい）のネタを先日書いたけど、書き方やバージョンがpreg_replace_callbackも同様だと思ったら、またしてもそーではないらしい。

php5.2.2から [...]]]></description>
			<content:encoded><![CDATA[<p>正規表現に名前付キャプチャ（<strong>名前付き捕獲式集合</strong>と言うらしい）のネタを先日書いたけど、書き方やバージョンがpreg_replace_callbackも同様だと思ったら、またしてもそーではないらしい。<br />
<span id="more-273"></span></p>
<p>php5.2.2からの書き方以前に、preg_replace_callbackで名前付き捕獲式集合が使えるようになるのは5.2.7以降だそうです。。。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'foobar: 2008'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// PHP 5.2.7 以降で動作します</span>
<span style="color: #990000;">preg_replace_callback</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/(P?&lt;name&gt;\w+): (P?&lt;digit&gt;\d+)/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'callback'</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> callback<span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">Array</span>
<span style="color: #009900;">&#40;</span>
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> foobar<span style="color: #339933;">:</span> <span style="color: #cc66cc;">2008</span>
    <span style="color: #009900;">&#91;</span>name<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> foobar
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> foobar
    <span style="color: #009900;">&#91;</span>digit<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2008</span>
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2008</span>
<span style="color: #009900;">&#41;</span></pre></div></div>

<p>Pはなくてもいいのかな？</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/273/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>preg_replace_callbackに配列は無理っぽ</title>
		<link>http://wp.foliz.net/archives/265</link>
		<comments>http://wp.foliz.net/archives/265#comments</comments>
		<pubDate>Tue, 23 Feb 2010 14:08:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[preg_replace_callback]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=265</guid>
		<description><![CDATA[preg_replaceと同じ理屈でpreg_replace_callbackを配列指定できると信じ込んで凄くハマったのでメモメモ。

複数の正規表現を一気にかける場合、配列で指定しちゃうと楽チン。

$preg = a [...]]]></description>
			<content:encoded><![CDATA[<p>preg_replaceと同じ理屈でpreg_replace_callbackを配列指定できると信じ込んで凄くハマったのでメモメモ。<br />
<span id="more-265"></span></p>
<p>複数の正規表現を一気にかける場合、配列で指定しちゃうと楽チン。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$preg</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
  <span style="color: #0000ff;">'/正規表現/si'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'$1:$2'</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'/正規表現/si'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'$1=$2'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array_keys</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$preg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array_values</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$preg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>上と同じ理屈でpreg_replace_callbackも配列が可能と信じ込んでいた。<br />
<strong>ダメダメな例</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$preg</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
  <span style="color: #0000ff;">'/正規表現/si'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'callback1'</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'/正規表現/si'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'callback2'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace_callback</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array_keys</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$preg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array_values</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$preg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> callback1<span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':'</span><span style="color: #339933;">.</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> callback2<span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'='</span><span style="color: #339933;">.</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>どうやらこれはダメっぽい。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/265/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php正規表現 名前付キャプチャ</title>
		<link>http://wp.foliz.net/archives/260</link>
		<comments>http://wp.foliz.net/archives/260#comments</comments>
		<pubDate>Tue, 23 Feb 2010 07:52:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[正規表現]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=260</guid>
		<description><![CDATA[とっても不得意な正規表現。
ちと覚えておくと便利な技をメモっておくぞ。

マッチパターンを参照するときは通常
$matches[0],$matches[1],$matches[2]&#8230;などと順番に書いているので [...]]]></description>
			<content:encoded><![CDATA[<p>とっても不得意な正規表現。<br />
ちと覚えておくと便利な技をメモっておくぞ。<br />
<span id="more-260"></span></p>
<p>マッチパターンを参照するときは通常<br />
$matches[0],$matches[1],$matches[2]&#8230;などと順番に書いているので<br />
どっかでパターンの変更があった場合は、0から順番に数えなおさなければならんのでメンテナンス性も悪ければ、とても読みにくい。<br />
時間がたてばたつほど、自分で書いたソースなのに追うのが大変になってしまう。</p>
<p>そこでマッチしたパターンに名前を付けれるのを最近知った。</p>
<p>php5.2.2以前と以降で使い方が違うので注意。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'foobar: 2008'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// PHP 5.2.2 以降で動作します</span>
<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/(?&lt;name&gt;\w+): (?&lt;digit&gt;\d+)/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// PHP 5.2.2 より前のバージョンではこれを使います</span>
<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/(?P&lt;name&gt;\w+): (?P&lt;digit&gt;\d+)/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>上の例の出力は以下となります。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">Array</span>
<span style="color: #009900;">&#40;</span>
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> foobar<span style="color: #339933;">:</span> <span style="color: #cc66cc;">2008</span>
    <span style="color: #009900;">&#91;</span>name<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> foobar
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> foobar
    <span style="color: #009900;">&#91;</span>digit<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2008</span>
    <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2008</span>
<span style="color: #009900;">&#41;</span></pre></div></div>

<p>参考：<br />
php :: 正規表現 :: 名前つきキャプチャというのを習った<br />
<a href="http://blog.3ot.net/design/php/20091018012202.html">http://blog.3ot.net/design/php/20091018012202.html</a></p>
<p>2010/02/24 リンク修正</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/260/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>携帯用Apacheモジュール「mod_ktai」</title>
		<link>http://wp.foliz.net/archives/248</link>
		<comments>http://wp.foliz.net/archives/248#comments</comments>
		<pubDate>Mon, 22 Feb 2010 08:20:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=248</guid>
		<description><![CDATA[Apacheにインストールしておいて
携帯サイトの各キャリア用にいろいろと自動変換してくれるらしい。
mod_ktai
http://labs.yumemi.co.jp/

ただし、インストールにはいろいろ制限があるよう [...]]]></description>
			<content:encoded><![CDATA[<p>Apacheにインストールしておいて<br />
携帯サイトの各キャリア用にいろいろと自動変換してくれるらしい。<br />
<strong>mod_ktai</strong><br />
<a href="http://labs.yumemi.co.jp/">http://labs.yumemi.co.jp/</a><br />
<span id="more-248"></span></p>
<p>ただし、インストールにはいろいろ制限があるようで<br />
Apache、Boost、ImageMagickがパッケージでインストールされていないと<br />
ダメだとか。</p>
<p>主な機能は<br />
mod_ktai_info(端末情報取得モジュール)<br />
mod_ktai_emoji(絵文字変換モジュール)<br />
mod_ktai_image(画像変換モジュール)<br />
との事。</p>
<p>ところで・・・<br />
国内の携帯サイトはホントにキライだ。<br />
何でこの時代に1ページ200kとかshift-jisのみとかおかしくね？<br />
なんで携帯の会社にそれぞれ合わせて作らなきゃならんのだ？<br />
草の根通信みたいだよな。<br />
ホント日本の携帯会社さんよーいいかげんにしろよー</p>
<p>PCで携帯サイトを確認するためには公式サイトから<br />
アノ中途半端なビュアーを落として・・・アホか。<br />
media=&#8221;mobile&#8221;<br />
で全て解決させなさい。</p>
<p>以上・・愚痴でした（笑）</p>
<p>参考：<br />
<a href="http://www.plusmb.jp/2008/11/17/1291.html">携帯用Apacheモジュール「mod_ktai」をインストール</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/248/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
