Create a controller
Create the Controller directory under the application/directory and then create the Basecontroller in the controller directory to inherit the controller//NOTE: Basecontroller function is the global controller common Method Library
File name: BaseController.class.php
<? use rapid\core\controller; Use classextends controller{ // public method Library }
Then create Indexcontroller, inherit Basecontroller
<? phpnamespace Application\controller; Use classextends basecontroller{public function indexaction ()
{
echo "rapidphp frame";
}}
Simple control before the creation is complete, the following configuration routing, find the rapid/config/routing/directory, there are two files
App.inc.php//Controller method configuration, which allows routing calls to methods that are not allowed to be configured
<?phpnamespace rapid\config\routing; UseApplication\controller\indexcontroller; UseRapid\config\constants\app; Userapid\config\constants\app\routing;/** * Can access the class, interface, do not declare then do not have permission to access*/return Array(Indexcontroller::class=Array( ' Indexaction ' =Array(Routing:: Method_type = app::app_request_get,//request type GET request ), ));
uri.inc.php//Routing address configuration
<? phpnamespace rapid\config\routing; Use Application\controller\indexcontroller; Use rapid\config\constants\app\routing; /* */returnarray( array( Routing:: Class_name = Indexcontroller::class, routing::app_name = ' indexaction ' );
OK, Access//index/index.htm/index.html/index.php can be accessed in, to the Times, our first rapidphp app is created.
rapidphp 1.1.0-Create your first app