PHP OOP 链接制作器?
我在 php 中编写了一个类,我需要在该类的函数中编写的所有引用都有一个前缀。那就是...
class MyClass
{
function echoing()
{
$class = new LinkMaker();
return $class->create(array('href' => 'popular/books/', 'title' => 'Popular books of 2010'));
}
}
然后在 LinkMaker 类中我向链接添加一个前缀..我想做吗? 抱歉英语不好
I write a class in php and I need that all references that I am writing in the functions of the class had a prefix. That is...
class MyClass
{
function echoing()
{
$class = new LinkMaker();
return $class->create(array('href' => 'popular/books/', 'title' => 'Popular books of 2010'));
}
}
And then in the class LinkMaker I add a prefix to the links .. Are all right I want to do?
sorry for bad english
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我明白你在说什么。您想在服务器端构建 DOM。
下面是我编写的重载 PHP 5 类,它可以执行此操作。它将采用任何 HTML 5 锚点属性。
用法:
I think I understand what you are saying. You want to kindof build the DOM on the server side.
Below is an Overloaded PHP 5 class I wrote which does this. It will take any HTML 5 anchor attribute.
Usage: