Symfony .. 视图上的超链接
My question is how to make a hyperlink in a view? Like <a href="link"></a>
in HTML. Have I to create it in an action method in the controller and then send it to a view? or what exactly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 Twig 模板引擎,您会看到类似的内容
如果您使用 PHP 作为模板,您会看到类似
homepage 的内容,上面的示例中是一个路由标识符,您必须已经在您的模板中定义了该路由标识符。路由配置
If you are using the Twig templating engine you would have something like
If you are using PHP for your templates you would have something like
homepage in the above examples is a route identifier that you must already have defined in your routing configuration
在视图中定义锚文本。
视图正如其字面意思,为访问者提供视图。控制器、模型均用于内部处理&应用程序的逻辑。
Define the anchor text in the view.
Views are exactly what they sound like they're for, providing view to the visitor. Controllers, models are all for the internal processing & logic of the application.