You are here: Re: classes and require ? « PHP Programming Language « IT news, forums, messages
Re: classes and require ?

Posted by Henrik Hansen on 03/12/07 13:03

avlee <xx@wp.pl> writes:

> Hello
>
> I have a big class in one php file.
> I would like to divide it to many smaller files. But when i try:
>
> <?php
>
> class IndexController extends Zend_Controller_Action
> {
> require_once('IndexController_common.php');
> require_once('IndexController_client_car.php');
>
> i receive parse error:
> "Parse error: syntax error, unexpected T_REQUIRE_ONCE, expecting
> T_FUNCTION in
> /mnt/hda5/www/zend/dg/car/application/controllers/IndexController.php
> on line 6"
>
> When i move require_once outside class definition everything works
> fine. But i need require inside
> of class because in thouse files are functions which are the member of
> that class.
> How can i do it ?

Put them in __construct()


--
Henrik Hansen

 

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

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