Home >Backend Development >PHP Tutorial >[PHP Development] Defining the core controller for building a shopping website

[PHP Development] Defining the core controller for building a shopping website

little bottle
little bottleforward
2019-04-20 11:06:302146browse

The main content of this article is to build the definition core controller of a shopping website. Friends who are interested can learn about it.

Method to implement jump:

1.Header function in Php

2Location function in js

3.Meta function in Html

Introduce message.html

<meta http-equiv="Refresh" content ="<?php echo $wait;?> ;url=<?php echo $url;?>"/>
<link href="application/views/admin/styles/general.css" rel="stylesheet" type="text/css" />
<link href="application/views/admin/styles/main.css" rel="stylesheet" type="text/css" />
<td style="font-size: 14px; font-weight: bold"><?php echo $message;?></td>
</tr>
<tr>
<td></td>
<td id="redirectionMsg">
<?php echo $wait;?> 秒之后跳转
</td>
</tr>
<tr>
<td></td>
<td>
<ul style="margin:0; padding:0 10px" class="msg-link"> 
<li><a href=""></a></li>
</ul>
</td>
</tr>
</table>
</div>
</div>

Establish a basic control class

<?php
class Controller{
   //跳转方法
   public  function jump($url,$message,$wait=3){
       if($wait==0){

           header("Location:$url");

       }else{

           include CUR_VIEW_PATH."message.html";
       }

       exit();//一定要退出die一样。

   }

}

?>

Related tutorials: PHP video tutorial

The above is the detailed content of [PHP Development] Defining the core controller for building a shopping website. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete