<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Forum posts to 'Archive'</title>
		<link>http://www.silverstripe.org/archive/rss</link>
		<atom:link href="http://www.silverstripe.org/archive/rss" rel="self" type="application/rss+xml" />
		<description></description>

		
		<item>
			<title>Re: Templating: how to access $REQUEST variables?</title>
			<link>http://www.silverstripe.org/archive/show/61053?start=0#post61531</link>
			<description>&lt;p&gt;yeah, its true, and after hard work yesterday i understood how to prepare objects in this way, the trouble was, that until SS i worked with commercial CMS with coded source, so all objects were prepared for template from core and then the smarty was very good in this case because it can work with arrays in all ways. now i see templating way it should be. Thanks.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Templating: how to access $REQUEST variables? &lt;a href=&quot;http://www.silverstripe.org/archive/show/61053?start=0#post61531&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/61053?start=0#post61531&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Fri, 25 Apr 2008 19:55:07 +1200</pubDate>
			<dc:creator>pIscIs</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/61053?start=0#post61531</guid>
		</item>
		
		<item>
			<title>Re: Templating: how to access $REQUEST variables?</title>
			<link>http://www.silverstripe.org/archive/show/61053?start=0#post61457</link>
			<description>&lt;p&gt;The reason that you're finding this a little difficult is that we don't really encourage this style of development with SilverStripe.  You should keep your logic in your Controller or DataObject layers, and use the templates to describe how the HTML and CSS should be put together.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Templating: how to access $REQUEST variables? &lt;a href=&quot;http://www.silverstripe.org/archive/show/61053?start=0#post61457&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/61053?start=0#post61457&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Fri, 25 Apr 2008 14:41:31 +1200</pubDate>
			<dc:creator>Sam</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/61053?start=0#post61457</guid>
		</item>
		
		<item>
			<title>Re: Templating: how to access $REQUEST variables?</title>
			<link>http://www.silverstripe.org/archive/show/61053?start=0#post61100</link>
			<description>&lt;p&gt;The way is proper if you have some variable you must get in template, but lets say we have a filter form with a lot of select fields which has option loaded from control(DB), so how then check which option is selected in filter when we displaying its results? Now im using a basic function which adds and extra field in object from db:&lt;br /&gt;function selectedControl(&amp;amp;$object, $selected, $var) {&lt;br /&gt;if(empty($selected)) return;&lt;br /&gt;foreach ($object as $item)&lt;br /&gt;if($item-&amp;gt;$var == $selected) $item-&amp;gt;Selected = &quot; selected=\&quot;selected\&quot;&quot;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;but in this way we have two loops(foreach and control, in big amount of data, this will be slowly) and this way isnt very comfortable. &lt;br /&gt;So the question would be - has SSViewer ability to parse array or object in if statment?&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Templating: how to access $REQUEST variables? &lt;a href=&quot;http://www.silverstripe.org/archive/show/61053?start=0#post61100&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/61053?start=0#post61100&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 24 Apr 2008 20:44:32 +1200</pubDate>
			<dc:creator>pIscIs</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/61053?start=0#post61100</guid>
		</item>
		
		<item>
			<title>Re: Templating: how to access $REQUEST variables?</title>
			<link>http://www.silverstripe.org/archive/show/61053?start=0#post61076</link>
			<description>&lt;p&gt;I dont know if this is the proper way to do it but if I need to access a GET var or anything I just create a method and have that return my varible. for example function PageID { return $_GET['PageID']; } (ive removed all the issets/ and checking for the sake of this. And then in the template you can use $PageID to access that GET var. &amp;lt;% 2 = $PageID %&amp;gt;&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Templating: how to access $REQUEST variables? &lt;a href=&quot;http://www.silverstripe.org/archive/show/61053?start=0#post61076&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/61053?start=0#post61076&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 24 Apr 2008 18:31:30 +1200</pubDate>
			<dc:creator>willr</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/61053?start=0#post61076</guid>
		</item>
		
		<item>
			<title>Templating: how to access $REQUEST variables?</title>
			<link>http://www.silverstripe.org/archive/show/61053#post61053</link>
			<description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;i building my first silverstripe portal and stuck at the question how to access $REQUEST variables(like $_GET, $_POST, $_SESSION) in templates? lets say, smarty has reserved variable $smarty in witch i can access these vars. I tried do functions in SS to retrieve these vars, like&lt;br /&gt;function listGET() {&lt;br /&gt;  return $_GET;&lt;br /&gt;}&lt;br /&gt;In the template $listGET.foo show the value of $_GET['foo'] var, but how then it use in if statments? &amp;lt;% if a = listGET.foo %&amp;gt; returns a parse error about unexpected &quot;}&quot; at template.&lt;br /&gt;Any help please.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Templating: how to access $REQUEST variables? &lt;a href=&quot;http://www.silverstripe.org/archive/show/61053#post61053&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/show/61053#post61053&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 24 Apr 2008 17:49:44 +1200</pubDate>
			<dc:creator>pIscIs</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/61053#post61053</guid>
		</item>
		

	</channel>
</rss>