dsfh40613182
2018-07-20 03:18
浏览 108
已采纳

什么是`{$ smarty.server.PHP_SELF}?action = bulkdomain`在smarty模板中意味着什么?

I am reading a smarty project code, there is a .tpl file, and in it there is a form, its action is {$smarty.server.PHP_SELF}?action=bulkdomain:

<form method="post" action="{$smarty.server.PHP_SELF}?action=bulkdomain">
...

what is this mean?

Does it means submit this request to the .tpl's corresponding .php file? but how about the .php file the function like? because the php code is close sourced, I can not get it.


EDIT-01

I mean, in the template, use the action="{$smarty.server.PHP_SELF}?action=bulkdomain" for assigning the request method.

how about the request method should be in the template corresponding php file?

should it like this?

<?php

function bulkdomain($params)
{
    ...
}

EDIT-02

In the current running php file:

<?php

require($_SERVER['DOCUMENT_ROOT'] . '/smartyHeader.php');
$smarty->registerPlugin('block' ,'hsp', 'test1');

$smarty->assign('foo', 'Foo');

$smarty->display('php/test.tpl');

if there submit the data, whether I will write the code in the php file like this?

<?php

require($_SERVER['DOCUMENT_ROOT'] . '/smartyHeader.php');
$smarty->registerPlugin('block' ,'hsp', 'test1');

$smarty->assign('foo', 'Foo');

$smarty->display('php/test.tpl');

// accept the code
$action =$_GET['action']

whether I accept the action like upper writing code?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题