<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1026280" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1026280</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-variable-function-args-array#comment-1158681</link>
    <description> &lt;p&gt;clear as mud on a sunny day with a westerly gale blowing.&lt;/p&gt;
&lt;p&gt;use a switch statement in the function class to control it all&lt;/p&gt;
&lt;p&gt;hard when you don&#039;t have the full story but I know what its like when just wanting a small bit of a large picture.&lt;/p&gt;
&lt;p&gt;several longer ways to do it also, define $foo&#039;s&lt;br /&gt;
define foo1 {404,search, nav,footer}&lt;br /&gt;
define foo2 {500,nav}&lt;br /&gt;
define foo3 {contact,search, help,dirty pic, toast}&lt;br /&gt;
define foo4 {none of the above}&lt;br /&gt;
....&lt;br /&gt;
new foo(foo2)&lt;/p&gt;
 </description>
     <pubDate>Sun, 12 Sep 2004 22:55:30 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1158681 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-variable-function-args-array#comment-1158647</link>
    <description> &lt;p&gt;The class is huge, huge. Seven functions and growing. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Also, the navigation and search box is just an example; I have more detailed, unique bits.* It won&#039;t be on all pages. There are about five different cases I have so far, and they do change often.&lt;/p&gt;
&lt;p&gt;Renegade, that is sample code, and I have made a typing mistake as I invented it. The real code &quot;works&quot; -- no silly errors like that, no need for debugging. This is more of a theory question in that sense.&lt;/p&gt;
&lt;p&gt;* I&#039;m avoiding explaining the real scenario because it&#039;s not a generic web site. Instead, it&#039;s an intranet web application. The bits I have that change are like widgets, and there are many of them, changing based on the application view selected. They follow a similar structure, though, like a header/title and utility/tool bar at the top, message box, content area, footer and diagnostics. It&#039;s only the content of these regions that changes (sometimes NULL) -- the data comes from the functions in the class.&lt;/p&gt;
&lt;p&gt;Clear as mud? &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 12 Sep 2004 11:52:38 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1158647 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-variable-function-args-array#comment-1158643</link>
    <description> &lt;p&gt;I know you only posted part of the code but if your class only has one function/condition it&#039;s not worth putting it inside a class.&lt;br /&gt;
Also if the navigation and search will be on all pages you can just use a function&lt;/p&gt;
&lt;p&gt;function foo($foofoo)&lt;br /&gt;
{&lt;br /&gt;
//get whatever $foofoo is, like:&lt;br /&gt;
echo template header value&lt;br /&gt;
  display $foofoo&lt;br /&gt;
echo template&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;if ($page==&quot;default&quot;) {&lt;br /&gt;
foo($default);&lt;br /&gt;
}elseif($page==&quot;404&quot;){&lt;br /&gt;
foo($error);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;depending how big it&#039;s going to get you can define a lot of the $foofoo values.&lt;br /&gt;
If the navigation and search wont always be on all pages you can call foo() with 3 values, foo($foofoo,1,0) 1 and 0 being true and false and the actual function works out the rest.&lt;/p&gt;
 </description>
     <pubDate>Sun, 12 Sep 2004 11:30:33 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1158643 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-variable-function-args-array#comment-1158640</link>
    <description> &lt;p&gt;You have:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if ($page=&amp;quot;default&amp;quot;)&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
and&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;} elseif ($page=&amp;quot;404&amp;quot;)&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;correct me if I&#039;m wrong but isn&#039;t it ment to be &quot;==&quot; ?&lt;/p&gt;
 </description>
     <pubDate>Sun, 12 Sep 2004 09:42:47 +0000</pubDate>
 <dc:creator>Renegade</dc:creator>
 <guid isPermaLink="false">comment 1158640 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-variable-function-args-array#comment-1158631</link>
    <description> &lt;p&gt;I&#039;m now using pretty much what I posted above, only I&#039;ve set $foo-&amp;gt;header() or $foo-&amp;gt;not_found() to take only one parameter:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;Class &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;foo &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;{&lt;br /&gt;&amp;nbsp; function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;header &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$args&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$something &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$args&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$nextthing &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$args&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
I don&#039;t know if it&#039;s a makeshift solution or that proper way to do it. It works for now, but I&#039;m open to suggestions...&lt;/p&gt;
 </description>
     <pubDate>Sun, 12 Sep 2004 04:33:00 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1158631 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
