<?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>ramblings &#187; delete button</title>
	<atom:link href="http://techore.com/tag/delete-button/feed/" rel="self" type="application/rss+xml" />
	<link>http://techore.com</link>
	<description>come to your own conclusions</description>
	<lastBuildDate>Mon, 30 Aug 2010 15:08:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>quickie: creating symfony delete button</title>
		<link>http://techore.com/2010/01/quickie-creating-symfony-delete-button/</link>
		<comments>http://techore.com/2010/01/quickie-creating-symfony-delete-button/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 17:59:47 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[delete button]]></category>
		<category><![CDATA[delete link]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[quickie]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[symfony 1.2]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=246</guid>
		<description><![CDATA[Many months ago I had asked for help on the symfony forums on how to create a delete button using either the link_to() or button_to() method. I had tried but was always getting validation errors. Today a person asked whether anyone had figured out a solution. It prompted me to do more research into symfony's core code and found a solution (though the solution wasn't in the core code).

Original delete text link code:

echo link_to('Delete', 'state/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?'));
New delete BUTTON link code:

echo link_to('Delete', 'state/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?'));
Till Next Time]]></description>
			<content:encoded><![CDATA[<p>Many months ago I had asked for help on the symfony forums on how to create a delete button using either the link_to() or button_to() method.  I had tried but was always getting validation errors.  Today a person asked whether anyone had figured out a solution.  It prompted me to do more research into symfony&#8217;s core code and found a solution (though the solution wasn&#8217;t in the core code).</p>
<p>Original delete text link code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> link_to<span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'Delete'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'state/delete?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</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;">'method'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'delete'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'confirm'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Are you sure?'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>New delete BUTTON link code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> link_to<span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'&lt;button&gt;Delete&lt;/button&gt;'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'state/delete?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</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;">'method'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'delete'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'confirm'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Are you sure?'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2010/01/quickie-creating-symfony-delete-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
