You are here: Re: Using a function within a class « PHP Programming Language « IT news, forums, messages
Re: Using a function within a class

Posted by Jerry Stuckle on 10/20/05 02:23

Bloke Smith wrote:
> I have written a class (and it works!).
> Now I want to tidy the code a bit by separating some subroutines and I
> get a "Fatal error: Call to undefined function:"
>
> e.g.
> class Fred{
> function Fred(){
> //constructor
>
> do_this();
> }
>
> function do_this(){ blah blah }
> }
>
> Please can someone tell what I'm doing wrong? If I use
> function_exists(do_this) it returns false.
> I've tried putting the function as the first block in the class.
> I've tried calling it as a method e.g. $this->do_this();
>
> PHP 4.3.9 on IIS (localhost)
>
> Thanks in advance
>
> Pete

$this->do_this();

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация