Recommend this page to a friend! |
Classes of Nitesh Apte | Define MVC PHP 8 | README.md | Download |
|
DownloadDefine MVC PHP 8Define MVC is a *Front Controller* based light weight MVC framework for developing web based applications. It is an open source and will remain always. Define MVC PHP 5.3 - 7.2 ###First release of Define MVC supports PHP 5.3 to PHP 7.2. You can get it from <a href="https://github.com/niteshapte/define-mvc/">*HERE*</a>. ContributePlease feel free to contribute. But try to keep the implementation simple so that a developer working for first time shouldn't find it difficult to understand and use it. RequirementPHP 8.0+ Virtual HostWhile developing I created a virtual host for this framework. Request you guys to do the same. Probably it will not work if you try to access it like _htt<area>p://localhost/define-mvc-php-8/_. Creating a Virtual HostAdd below line in Create a file <VirtualHost *:80>
</VirtualHost> </pre> Add below line in Run below command on terminal to restart apache - <br>
_Please note above configurations were done in my linux machine. You must do according to your setup._ How to use itDefine MVC is a front controller based MVC framework just like any other MVC framework. So, all the request are redirected to bootstrap.php page. Please have a look at Folder StructurePlease don't skip this section. Go through the below folder structure to understand how Define MVC and project / application classes and files will be organized.
All the files related to your project will be inside 'application' folder. However, you can change the configurations defined in ControllerBy default, Define MVC follow below URL pattern: _http<area>://www<area>.domain.com/controller/action/param1-param2/_ For example, if the URL is htt<area>p://www<area>.example.com/user/profile/33-90/, or you want to create this url, then craete <pre> class UserController extends ApplicationController {
}
</pre>
Check IndexController inside ViewAll the view files will be inside You can add display value in view by using View object. For example: <pre> class UserController extends ApplicationController {
} </pre> In
RepositoryRefer to As a good practice, call repository classes from service classes. ServiceRefer to TestAfter setting up define-mvc-php-8 in your local server, try accessing the following: http://www.define.mvc http://www.define.mvc/index/ http://www.define.mvc/index/default/me-you/ http://www.define.mvc/index/test-from-service/ ConfigurationDefine MVC is completely configurable. For example, you want your UserController to be UserXYZ go to TODOWrite unit tests |