Hi there!
Sorry the basic doubt but is there any recommended way to open a file using symfony? I'm trying to open a MarkDown source file.
Thanks for the help, Best regards!
Hi there!
Sorry the basic doubt but is there any recommended way to open a file using symfony? I'm trying to open a MarkDown source file.
Thanks for the help, Best regards!
I don't think there is a special symfony way.
Just use the normal PHP filesystem functions for that, e.g. file_get_contents
The sfMarkdownPlugin README file details the Markdown processing for file contents. In the directions it uses the symfony 'data' directory to store the file, and uses the sfConfig class to access the file contents.
$file = sfConfig::get('sf_data_dir').'/content/about.txt';
if (!is_readable($file))
...
You asked for a symfony way to read a file, there it is.
See further; http://www.symfony-project.org/plugins/sfMarkdownPlugin/0_1_1?tab=plugin_readme