This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.1 » Config handlers trouble
Config handlers trouble [message #63400] Sat, 18 October 2008 08:20 Go to next message
quocbao  is currently offline quocbao
Messages: 12
Registered: October 2008
Location: Vietnam
Junior Member
Hi,

I want to use custom config handler in sf 1.1 but i got some trouble Sad

I followed the tutorial on http://www.symfony-project.org/book/1_1/19-Mastering-Symfony -s-Configuration-Files but i just couldn't get the handler to be loaded.

Here's my implementation

project/configs/config_handlers.yml :

config/menu.yml:
  class: ACPMenuConfigHandler


I put my ACPMenuConfigHandler class in project/lib/ACPMenuConfigHandler.class.php

class ACPMenuConfigHandler extends sfYamlConfigHandler
{
    public function execute($configFile)
    {
    	return "<?php \"I run\"; ?>";
    }
}


And in project/config/menu.yml

- Just For Testing


And when i ran frontend.php I got the error said that "ACPMenuConfigHandler" can not be found, but if I used frontend_dev.php I got no result at all. Even i put "echo 'are u running';" in cache/dev/config/config_config_handlers.php (config cache) but no thing happen ????

Any ideas ?
Re: Config handlers trouble [message #63609 is a reply to message #63400 ] Tue, 21 October 2008 18:33 Go to previous messageGo to next message
kriswallsmith  is currently offline kriswallsmith
Messages: 43
Registered: September 2007
Location: Portland, Oregon USA
Member
HI quocbao,

The config_handlers.yml file is parsed before sfAutoload is registered. Add a "file" node to you yaml and it should work fine. Something like this...

config/menu.yml:
  class: ACPMenuConfigHandler
  file: %SF_LIB_DIR%/config/ACPMenuConfigHandler.class.php


Thanks,
Kris
Re: Config handlers trouble [message #63611 is a reply to message #63400 ] Tue, 21 October 2008 18:44 Go to previous message
quocbao  is currently offline quocbao
Messages: 12
Registered: October 2008
Location: Vietnam
Junior Member
Ok, nice

I've fixed it Smile
Previous Topic:multiple step forms
Next Topic:can not iterate through formwidget
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software