I want to make some action (php script) before all actions in my frontend app and then pass a result from that script to actions in variable - so I can get variable value from a
What kind of information ?
I would recommend you to use filters.
In your apps/frontend/config/filters.yml
:
rendering: ~
myfilter:
class: myCustomFilter
Create the file lib/filter/myCustomFilter.php
:
isFirstCall())
{
// do what ever you want here.
$config = Doctrine_Core::getTable('Config')->findAll();
sfConfig::set('my_config', $config);
}
$filterChain->execute();
}
}
And then, every where, you can retrieve your data:
sfConfig::get('my_config');