Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 272 | All time: 7,703 This week: 455 |
Version | License | PHP version | Categories | |||
define-mvc 1.1 | GNU General Publi... | 5.5 | PHP 5, Libraries, Design Patterns |
Description | Author | |
This package implements a front controller based MVC framework. |
<?php
|
Define MVC is a Front Controller based MVC framework for developing web based applications. It is an open source and will always remain.
The name Define because you can define it the way you want. I have tried to keep everything configurable.
IMPORTANT: While developing this framework, I had a virtual host created for it. Request you guys to do the same. Probably it will not work if you try to access it like htt://localhost/define-mvc/
Please 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.
Since it is a Front Controller based MVC, the URL should be in the following pattern:
http://www.domain.com/controller/action/param1-param2/
So, if the URL is http://www.example.com/user/profile/33-90/ then:
<pre> <code>
class UserController extends ApplicationController {
public function profileAction($param1, $param2) {
// logic goes here
}
} </code> </pre>
Check IndexController inside application/controller to get an idea.
All the view files will be inside 'application/view/' folder.
You can add display value in view by using View object. For example:
<pre> <code> class UserController extends ApplicationController {
public function profileAction($param1, $param2) {
$this->view->addObject("msg", "I am the value to be displayed.");
$this->view->render('user');
}
} </code> </pre>
In 'view' folder, create a file named 'user.php', and put the following code:
<pre> <code> echo $msg </code> </pre>
All the files related to your project will be inside 'application' folder. However, you can change the configurations defined in 'configuration/define.inc'.
To test after importing the project in your local server, try accessing the following:
http://www.domain.com/
http://www.domain.com/index/default/me-you/
http://www.domain.com/index/test-from-service/
http://www.domain.com/index/test-from-dao/
where domain.com is your local server.
Define MVC is completely configurable.
For example, you want your UserController to be UserXYZ go to 'configuration/define.inc' and change CONTROLLER_SUFFIX to XYZ. Similarly, you can change other configuration properties.
Check docs/index.html for API documentation.
// More documentation to come. However, it's open for contribution.
Files (206) |
File | Role | Description | ||
---|---|---|---|---|
application (5 directories) | ||||
configuration (2 files) | ||||
dbscripts (6 files) | ||||
docs (117 files, 1 directory) | ||||
lib (2 directories) | ||||
logs (1 file) | ||||
.htaccess | Data | Auxiliary data | ||
bootstrap.php | Example | Example script | ||
LICENSE | Lic. | License | ||
README.md | Doc. | Auxiliary data |
Files (206) | / | application |
File | Role | Description | ||
---|---|---|---|---|
bean (1 file) | ||||
controller (3 files) | ||||
i18n (8 directories) | ||||
model (2 directories) | ||||
view (2 files, 4 directories) |
Files (206) | / | application | / | controller |
File | Role | Description |
---|---|---|
ApplicationController.php | Class | Class source |
ErrorController.php | Class | Class source |
IndexController.php | Class | Example class |
Files (206) | / | application | / | i18n |
Files (206) | / | application | / | model |
Files (206) | / | application | / | model | / | dao |
File | Role | Description | ||
---|---|---|---|---|
impl (1 file) | ||||
ApplicationDAO.php | Class | Class source |
Files (206) | / | application | / | model | / | dao | / | impl |
File | Role | Description |
---|---|---|
IndexDAO.php | Class | Class source |
Files (206) | / | application | / | model | / | service |
File | Role | Description | ||
---|---|---|---|---|
impl (1 file) | ||||
ApplicationService.php | Class | Class source |
Files (206) | / | application | / | model | / | service | / | impl |
File | Role | Description |
---|---|---|
IndexService.php | Class | Class source |
Files (206) | / | application | / | view |
Files (206) | / | configuration |
File | Role | Description |
---|---|---|
application.inc | Conf. | Configuration script |
define.inc | Conf. | Configuration script |
Files (206) | / | dbscripts |
File | Role | Description |
---|---|---|
mongo.application.sql | Data | Auxiliary data |
mssql.application.sql | Data | Auxiliary data |
mysql.application.sql | Data | Auxiliary data |
oracle.application.sql | Data | Auxiliary data |
postgres.application.sql | Data | Auxiliary data |
sqlite.application.sql | Data | Auxiliary data |
Files (206) | / | docs |
Files (206) | / | docs | / | resources |
File | Role | Description |
---|---|---|
collapsed.png | Icon | Icon image |
combined.js | Data | Auxiliary data |
footer.png | Data | Auxiliary data |
inherit.png | Icon | Icon image |
resize.png | Icon | Icon image |
sort.png | Icon | Icon image |
style.css | Data | Auxiliary data |
tree-cleaner.png | Icon | Icon image |
tree-hasnext.png | Icon | Icon image |
tree-last.png | Data | Auxiliary data |
tree-vertical.png | Icon | Icon image |
Files (206) | / | lib | / | define |
Files (206) | / | lib | / | define | / | core |
File | Role | Description |
---|---|---|
BaseController.php | Class | Class source |
BaseDAO.php | Class | Class source |
BaseModel.php | Class | Class source |
BaseService.php | Class | Class source |
Framework.php | Class | Class source |
IBaseDAO.php | Class | Class source |
IBaseModel.php | Class | Class source |
IBaseService.php | Class | Class source |
IDefine.php | Class | Class source |
IRouter.php | Class | Class source |
IView.php | Class | Class source |
ObjectContainer.php | Class | Class source |
Router.php | Class | Class source |
View.php | Class | Class source |
Files (206) | / | lib | / | define | / | dbdrivers |
File | Role | Description |
---|---|---|
DatabaseBean.php | Class | Class source |
DatabaseFactory.php | Class | Class source |
IDatabase.php | Class | Class source |
MONGODBDriver.php | Class | Class source |
MSSQLDriver.php | Class | Class source |
MYSQLDriver.php | Class | Class source |
MYSQLIDriver.php | Class | Class source |
ORACLEDriver.php | Class | Class source |
PDODriver.php | Class | Class source |
POSTGREDriver.php | Class | Class source |
SQLITEDriver.php | Class | Class source |
Files (206) | / | lib | / | define | / | exceptions |
File | Role | Description |
---|---|---|
FileNotFoundException.php | Class | Class source |
FrameworkException.php | Class | Class source |
IException.php | Class | Class source |
LoggerException.php | Class | Class source |
NullPointerException.php | Class | Class source |
RuntimeException.php | Class | Class source |
Files (206) | / | lib | / | define | / | utilities |
File | Role | Description |
---|---|---|
ErrorCodes.inc | Data | Auxiliary data |
ErrorExceptionHandler.php | Class | Class source |
ExceptionCodes.inc | Data | Auxiliary data |
IUtilities.php | Class | Class source |
Localization.php | Class | Class source |
Logger.php | Class | Class source |
PasswordHelper.php | Class | Class source |
Session.php | Class | Class source |
Files (206) | / | lib | / | vendors | / | phpmailer |
File | Role | Description |
---|---|---|
PHPMailer.php | Class | Class source |
SMTP.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.