简体   繁体   English

如何在Perl CGI程序的每个页面上重复菜单栏?

[英]How can I repeat the menu bar on every page from a Perl CGI program?

I have a page named Main.cgi where in I have a horizontal menu bar with UserList logs and so on like the Menu above Questions Tags Users etc. Whenever I click the Userlist I get navigated to another page where I have a grid. 我有一个名为Main.cgi的页面,其中有一个带有UserList日志的水平菜单栏,诸如“问题标签用户”上方的菜单等。每当我单击“用户列表”时,我都会导航到另一个有网格的页面。 In this page also I want that Menu bar which was in Main.cgi , and so on. 在此页面中,我还想要Main.cgi中的菜单栏,依此类推。 It should get repeated to every page. 它应该重复到每一页。

You probably want to make the code that created the menu bar into a function in a module that you can load from every CGI program on your web site. 您可能想将创建菜单栏的代码变成一个模块中的功能,您可以从网站上的每个CGI程序中加载该模块。

But really, you should be looking at using a templating system to produce all of the HTML for your system. 但实际上,您应该考虑使用模板系统系统生成所有HTML。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM