设计模型问题 [英] Design Model Question
问题描述
我第一次尝试了一个不那么活跃的PHP小组,但是让我试试这里。
我搜索了这个,但没有找到任何与之相关的东西。
可能我不知道要搜索什么。
我正在设计一个使用PHP的Web应用程序,我相对而言
新。我已经看到一些网站使用该模型,其中创建了一个索引页面
来处理身份验证并接收选项参数
告诉索引在页面正文中加载什么。例如,
可以传递$ page = AccountIndex.php告诉索引包含
帐户索引页面使用:
require_once $页面;
到达那里的链接看起来像:
< a href ="<?= $ _ SERVER [''PHP_SELF' ']?>?page = AccountIndex.php">帐号
索引< / a>
或者,该链接实际上可能指的是另一个页面
(例如,< a href =" ./ AccountIndex.php">帐户索引< / a>)并且可以使用它自己加载
验证和接收自己的参数。
我希望这是足够明确的。
问题是:
任何人都可以对这些模型中的每一个提供优点/缺点的意见吗?
任何人都可以提供正确的术语来讨论这些想法所以
我可以寻找更多相关资源。
谢谢,
Mi ke
I had first tried a less active PHP group, but let me try here.
I searched for this, but didn''t find anything that appeared related.
Possibly I didn''t know what to search for.
I am designing a web application using PHP, to which I am relatively
new. I have seen some sites use the model whereby a single index page
is created that handles authentication and receives option parameters
telling the index what to load in the body of the page. For example,
one could pass $page=AccountIndex.php to tell the index to include the
account index page using:
require_once $page;
And the link to get there would look like:
<a href="<?=$_SERVER[''PHP_SELF'']?>?page=AccountIndex.php">Account
Index</a>
Alternatively, the link could actually refer to a different page
(e.g., <a href="./AccountIndex.php">Account Index</a>) and that could
be loaded using its own authentication and receive its own parameters.
I hope this is sufficiently clear.
The questions are:
Can anyone provide opinions on advantages/disadvantages to each of
these models?
Can anyone provide the correct terminology to discuss these ideas so
that I can look for more, relevant resources.
Thank you,
Mike
推荐答案
page = AccountIndex.php告诉索引包含
帐户索引页面使用:
require_once
page=AccountIndex.php to tell the index to include the
account index page using:
require_once
页面;
到达那里的链接如下:
< ; a href ="<?=
page;
And the link to get there would look like:
<a href="<?=
_SERVER [''PHP_SELF'']?>?page = AccountIndex.php">帐户
索引< / a>
或者,链接实际上可以引用不同的页面
(例如,< a href =" ./ AccountIndex。 php">帐户索引< / a>)并且可以使用自己的身份验证加载
并接收自己的参数。
我希望这是足够清楚。
问题是:
任何人都可以对这些模型中的每一个提供有关优缺点的意见吗?
任何人都可以提供正确的术语来讨论这些想法,所以我可以使用b $ b寻找更多相关资源。
谢谢,
Mike
_SERVER[''PHP_SELF'']?>?page=AccountIndex.php">Account
Index</a>
Alternatively, the link could actually refer to a different page
(e.g., <a href="./AccountIndex.php">Account Index</a>) and that could
be loaded using its own authentication and receive its own parameters.
I hope this is sufficiently clear.
The questions are:
Can anyone provide opinions on advantages/disadvantages to each of
these models?
Can anyone provide the correct terminology to discuss these ideas so
that I can look for more, relevant resources.
Thank you,
Mike
这篇关于设计模型问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!