<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Call Controller Functions or Access Controller Variables from Views</title>
	<atom:link href="http://anupom.wordpress.com/2007/01/08/call-controller-functions-or-access-controller-variables-from-views/feed/" rel="self" type="application/rss+xml" />
	<link>http://anupom.wordpress.com/2007/01/08/call-controller-functions-or-access-controller-variables-from-views/</link>
	<description>Web Development, Java, PHP, Ruby, Javascript and many more!</description>
	<lastBuildDate>Tue, 22 Dec 2009 04:00:18 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nicholas</title>
		<link>http://anupom.wordpress.com/2007/01/08/call-controller-functions-or-access-controller-variables-from-views/#comment-6878</link>
		<dc:creator>Nicholas</dc:creator>
		<pubDate>Fri, 31 Aug 2007 21:34:22 +0000</pubDate>
		<guid isPermaLink="false">http://anupom.wordpress.com/2007/01/08/call-controller-functions-or-access-controller-variables-from-views/#comment-6878</guid>
		<description>Hi!

You seem to be knowledgeable about PHP controllers. Perhaps you can help me with a similar case.

I have a class which contains a controller and 2 functions.

Both functions need the same base array.

&lt;code&gt;class Blog_post extends Controller {

function Blog_post {

parent::controller

$basearray = array(&quot;global_item&quot;);

}

function new_post {

$basearray[&#039;specific_item1&#039;] = &quot;whatever&quot;

}

}&lt;/code&gt;

Unfortunately I get a PHP error when running newpost() that $basearray is undefined.

How can I access $basearray from other functions in the class?

Thanks,

Nicholas</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>You seem to be knowledgeable about PHP controllers. Perhaps you can help me with a similar case.</p>
<p>I have a class which contains a controller and 2 functions.</p>
<p>Both functions need the same base array.</p>
<p><code>class Blog_post extends Controller {</p>
<p>function Blog_post {</p>
<p>parent::controller</p>
<p>$basearray = array("global_item");</p>
<p>}</p>
<p>function new_post {</p>
<p>$basearray['specific_item1'] = "whatever"</p>
<p>}</p>
<p>}</code></p>
<p>Unfortunately I get a PHP error when running newpost() that $basearray is undefined.</p>
<p>How can I access $basearray from other functions in the class?</p>
<p>Thanks,</p>
<p>Nicholas</p>
]]></content:encoded>
	</item>
</channel>
</rss>
