模板概念--help! [英] template concept --help!
问题描述
我之前发过帖,但没有人回复,因为我认为这很令人困惑。
我的问题是我有一个用户有个人资料页面的网站,并且
他们每个人都可以选择他们自己的(即blogger.com)这点
的问题是......我怎样才能建立一个模板布局的系统(例如,3
可以为它创建列布局,2列,垂直,水平),因此它可以扩展且易于制作模板。对于?我只需要一些
概念和方法如何做到这一点请!!!!!!!!!!这是一个项目持有
,我真的很生气......
请给出示例代码...我有的系统现在有点像
这个...
/ * $ users数组的一些SQL查询,以及操作* /
$ t =新模板;
$ t-> _template_path = $ template_path; #/ core / templates / blue /
$ t-> _template = $ users [''template'']; #blue.template
$ t-> _css_file = $ users [''style_sheet'']; #''template.css'';等等
$ t-> _meta = $ users [''meta_tags'']; #users keywords etc
$ t-> _title = $ users [''title'']; #page of page" Johns page"
$ t-> _content = $ users [''content'']; #包含他们想要在主体div中的对象/模块
$ t-> _left_content = $ users [''left_content''] #left div content(如果
开启)
$ t-> _right_content = $ users [''right_content'']#right div content(如果
打开了)
$ t-> render(); #在模板类中绘制所有内容
它基本上只获取所有.template
文件,按顺序排列它们进行一些查询并回应它们......我需要帮助,这是一个好主意吗?这会太慢吗?
有更简单的方法吗?帮助!!!!!!!!!
I''ve posted before but no one replied because I think it was confusing.
My problem is that I have a website where users have profile pages, and
they can each chooser their own (i.e. blogger.com) Point of this
question is...how can I make a system where template layouts (e.g, 3
column layout, 2 column, vertical, horizontal) can be created for it so
it''s scalable and easy to make "templates" for? I just need some
concepts and methods of how to do this PLEASE!!!!!!!!!! this is holding
up a project and i''m REALLYYY getting annoyed with it...
PLEASE give example code...the system I have now is kind of like
this...
/* SOME SQL QUERIES FOR THE $users array, and manipulation */
$t = new template;
$t->_template_path = $template_path; # /core/templates/blue/
$t->_template = $users[''template'']; # blue.template
$t->_css_file = $users[''style_sheet'']; # ''template.css''; etc
$t->_meta = $users[''meta_tags'']; # users keywords, etc
$t->_title = $users[''title'']; # title of page "Johns page" etc.
$t->_content = $users[''content'']; # contains the objects/modules they
want in the main body div
$t->_left_content = $users[''left_content''] # left div content (if
turned on)
$t->_right_content = $users[''right_content''] # right div content (if
turned on)
$t->render(); # draw everything
inside the template class it basically just gets all the .template
files, arranges them in order does some queries and echoes them... I
need help, is this even a good idea? will this be way too slow? is
there a simpler way to do it? HELP!!!!!!!!!
推荐答案
用户数组和操作* /
users array, and manipulation */
t =新模板;
t = new template;
t-> _template_path =
t->_template_path =
这篇关于模板概念--help!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!