读取 Symfony 项目中的 markdown 文件
有没有推荐的方法来使用 Symfony 打开文件?我正在尝试打开 Markdown 源文件。
Is there any recommended way to open a file using Symfony? I'm trying to open a Markdown source file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不认为有特殊的 symfony 方式。
只需使用普通的 PHP 文件系统函数即可,例如
file_get_contents
I don't think there is a special symfony way.
Just use the normal PHP filesystem functions for that, e.g.
file_get_contents
sfMarkdownPlugin 自述文件详细介绍了文件内容的 Markdown 处理。在说明中,它使用 symfony 'data' 目录来存储文件,并使用 sfConfig 类来访问文件内容。
您要求使用 symfony 方式来读取文件,它就是。
进一步查看; http://www.symfony-project.org/plugins/sfMarkdownPlugin/ 0_1_1?tab=plugin_readme
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.
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