Skip to content

Commit

Permalink
added app name prefixes to controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
lewsid committed Jun 17, 2014
1 parent 6d69e85 commit 8cc2353
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 57 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Dinkly v2.04
Dinkly v2.05
============

The biggest little PHP framework
Expand Down
2 changes: 0 additions & 2 deletions apps/admin/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/**
* AdminController
*
*
*
* @package Dinkly
* @subpackage AppsAdminController
* @author Christopher Lewis <lewsid@lewsid.com>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?php
/**
* GroupController
*
* AdminGroupController
*
* @package Dinkly
* @subpackage AppsAdminGroupController
* @author Christopher Lewis <lewsid@lewsid.com>
*/

class GroupController extends AdminController
class AdminGroupController extends AdminController
{
protected $group;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php
/**
* HomeController
*
*
* AdminHomeController
*
* @package Dinkly
* @subpackage AppsAdminHomeHomeController
* @author Christopher Lewis <lewsid@lewsid.com>
*/
class HomeController extends AdminController
class AdminHomeController extends AdminController
{
public function __construct()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php
/**
* LoginController
*
*
* AdminLoginController
*
* @package Dinkly
* @subpackage AppsAdminLoginLoginController
* @author Christopher Lewis <lewsid@lewsid.com>
*/
class LoginController extends AdminController
class AdminLoginController extends AdminController
{
public function __construct()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php
/**
* UserController
*
*
* AdminUserController
*
* @package Dinkly
* @subpackage AppsDinklyUserController
* @author Christopher Lewis <lewsid@lewsid.com>
*/
class UserController extends AdminController
class AdminUserController extends AdminController
{
protected $user;

Expand Down
23 changes: 23 additions & 0 deletions apps/api/ApiController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* ApiController
*
*
* @package Dinkly
* @subpackage AppsApiController
* @author Christopher Lewis <lewsid@lewsid.com>
*/

class ApiController extends Dinkly
{
/**
* Default Constructor
*
* @return bool: always returns true on successful construction of view
*
*/
public function __construct()
{
return true;
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
<?php
/**
* ApiController
* ApiRouterController
*
* A ready-to-go Restful API, useful for interaction with JS MVC frameworks
*
* @package Dinkly
* @subpackage AppsApiController
* @author Christopher Lewis <lewsid@lewsid.com>
*/
class ApiController extends Dinkly
class ApiRouterController extends Dinkly
{
public function __construct()
{
parent::__construct();
}

/**
* Handle any errors that occur internally with Server Side Data
*
Expand Down
Empty file added apps/error/ErrorController.php
Empty file.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php
/**
* ErrorController
*
*
* ErrorHttpController
*
* @package Dinkly
* @subpackage AppsErrorErrorController
* @author Christopher Lewis <lewsid@lewsid.com>
*/
class ErrorController extends Dinkly
class ErrorHttpController extends Dinkly
{
/**
* Handle any URL errors when page is not found
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions apps/frontend/FrontendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

class FrontendController extends Dinkly
{
/**
* Default Constructor
*
* @return bool: always returns true on successful construction of view
*
*/
/**
* Default Constructor
*
* @return bool: always returns true on successful construction of view
*
*/
public function __construct()
{
return true;
Expand Down
28 changes: 28 additions & 0 deletions apps/frontend/modules/landing/FrontendLandingController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* FrontendLandingController
*
*
* @package Dinkly
* @subpackage AppsFrontendLandingController
* @author Christopher Lewis <lewsid@lewsid.com>
*/

class FrontendLandingController extends FrontendController
{
public function __construct()
{
parent::__construct();
}

/**
* Load default view
*
* @return bool: always returns true on successful construction of view
*
*/
public function loadDefault()
{
return true;
}
}
23 changes: 0 additions & 23 deletions apps/frontend/modules/landing/LandingController.php

This file was deleted.

2 changes: 1 addition & 1 deletion classes/core/base/BaseDinkly.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public function loadModule($app_name, $module_name = null, $view_name = 'default
}

//Get module controller
$camel_module_name = self::convertToCamelCase($module_name, true) . "Controller";
$camel_module_name = self::convertToCamelCase($app_name, true) . self::convertToCamelCase($module_name, true) . "Controller";
$controller_file = $_SERVER['APPLICATION_ROOT'] . '/apps/' . $app_name . '/modules/' . $module_name . '/' . $camel_module_name . '.php';

//Save these on the object so they can be retrieved as needed in controllers or views
Expand Down
6 changes: 3 additions & 3 deletions classes/core/base/BaseDinklyBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,17 @@ public static function buildModule($app_name, $module_name)
$fp = fopen($module_folder . "/views/default.php", 'w+');
fclose($fp);

$fp = fopen($module_folder . "/" . Dinkly::convertToCamelCase($module_name, true) . "Controller.php", 'w+');
$fp = fopen($module_folder . "/" . Dinkly::convertToCamelCase($app_name, true) . Dinkly::convertToCamelCase($module_name, true) . "Controller.php", 'w+');
fwrite($fp, '<?php' . PHP_EOL );
fwrite($fp, '/**'.PHP_EOL .
' * '.Dinkly::convertToCamelCase($module_name, true).'Controller'.PHP_EOL.
' *'.PHP_EOL .
' *'.PHP_EOL .
' * @package Dinkly'.PHP_EOL .
' * @subpackage Apps'.Dinkly::convertToCamelCase($app_name, true).Dinkly::convertToCamelCase($module_name, true).'Controller'.PHP_EOL .
' * @subpackage Apps'.Dinkly::convertToCamelCase($app_name, true) . Dinkly::convertToCamelCase($module_name, true).'Controller'.PHP_EOL .
' * @author Christopher Lewis <lewsid@lewsid.com>'.PHP_EOL .
' */' . PHP_EOL . PHP_EOL);
fwrite($fp, 'class ' . Dinkly::convertToCamelCase($module_name, true) . 'Controller extends ' . Dinkly::convertToCamelCase($app_name, true) . "Controller" . PHP_EOL . '{' . PHP_EOL);
fwrite($fp, 'class ' . Dinkly::convertToCamelCase($app_name, true) . Dinkly::convertToCamelCase($module_name, true) . 'Controller extends ' . Dinkly::convertToCamelCase($app_name, true) . "Controller" . PHP_EOL . '{' . PHP_EOL);
fwrite($fp,"\t/**".PHP_EOL .
"\t * Constructor".PHP_EOL .
"\t *".PHP_EOL .
Expand Down

0 comments on commit 8cc2353

Please sign in to comment.