A popular and easy-to-understand thinkphp made in the mvc framework. its functions are relatively powerful and many rules have been defined for us to facilitate our development.
A popular and easy-to-understand thinkphp made in the mvc framework. its functions are relatively powerful and many rules have been defined for us to facilitate our development, this tutorial is suitable for beginners to learn from a large number of visual screens or open-source code. let's take a look at thinkphp tutorials today.
First of all, we will install thinkphp. this is not much to explain. the official document of the entrance file only needs to be run once.
Next let's run the instance: First, create an IndexAction. class. php simple instance in the action, and write a few simple lines of output statements without being too complicated.
// This document is automatically generated for testing only
Class IndexAction extends Action
{
/**
+ ----------------------------------------------------------
* Default operation
+ ----------------------------------------------------------
*/
Public function index (){
$ This-> assign ('title', 'php hobby ');
$ This-> assign ('keyword', 'php development experiences, php source code sharing ');
$ This-> display ();
}
}
?>
Of course, we also need it in the model File. you can leave some complicated code in it, but you must reference it. why not use mvc, it can or cannot be achieved through model in many complex development processes.
IndexModel. class. php
Class IndexModel extends Model {
}
?>
Next, create an index directory under the Tpl \ default directory. this is the directory where we store the template.
Put your template page inside
{$ Title}
In this way, I will try to see if we can run our template. the principles of this template will be discussed in mvc later.