Hi Mauricio,

Can you post the actual config file being included?

My guess is that you should probably add the config values as
FrontController parameters ( see 
http://framework.zend.com/manual/en/zend.controller.front.html#zend.controller.front.methods.params
http://framework.zend.com/manual/en/zend.controller.front.html#zend.controller.front.methods.params
 
).

Then you can access from inside any Action, and use as the basis for any
in-Action paths where you are setting up new Zend_Config instances.

There are a few other ways of doing this (e.g. Zend_Registry) also.

I get the feeling your current config file being included outside the scope
of an Action class isn't working as you seem to intend. For example, how do
you think the config data excluded outside the class definition can be
included inside it for path referencing?

Let me know what you think :)

Paddy



Mauricio Cuenca wrote:
> 
> Hello,
> 
> I am building a new application and I want to place database stuff and
> configuration in one file. But when I include the files in any of the
> controller scripts I get an error.
> 
> I am sure the problem is not related to a file not found or a syntax
> error, I am doing something like this in IndexController.php:
> 
> /** Zend_Controller_Action */
> require_once 'Zend/Controller/Action.php';
> require_once 'Zend/View.php';
> 
> include_once 'myconfig.php';
> 
> Is not allowed to have files at this point? I have to include each one in
> each action function.
> 
> Thanks!
> 
> 
> 


-----
Pádraic Brady

http://blog.astrumfutura.com
http://www.patternsforphp.com
OpenID Europe Foundation - Irish Representative
-- 
View this message in context: 
http://www.nabble.com/Using-include_once-tp15333284s16154p15338844.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to