Skip to content

Commit

Permalink
Renamed s3mvc-create-controller* to smvc-create-controller* in prep f…
Browse files Browse the repository at this point in the history
…or slim 4 upgrade
  • Loading branch information
rotexdegba committed Apr 9, 2021
1 parent 8e31078 commit 9c9c5ea
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ of this template application framework.
* Ships whith a BaseController class (i.e. **`Slim3MvcTools\Controllers\BaseController`**) that provides methods for authentication, generating HTTP 404, 405 and 500 response objects and methods for rendering **php** view and layout files using the light-weight and easily extensible [Rotexsoft\FileRenderer\Renderer](https://github.com/rotexsoft/file-renderer) class

* Provides a command-line script for creating Controller classes (that extend **`Slim3MvcTools\Controllers\BaseController`** or any of its descendants).
* **`./vendor/bin/s3mvc-create-controller`** on **`*nix-like`** Oses and **`.\vendor\bin\s3mvc-create-controller.bat`** on **`Windows`**
* NOTE: **`./vendor/bin/s3mvc-create-controller-wizard`** is the interactive version of **`./vendor/bin/s3mvc-create-controller`**
* **`./vendor/bin/smvc-create-controller`** on **`*nix-like`** Oses and **`.\vendor\bin\smvc-create-controller.bat`** on **`Windows`**
* NOTE: **`./vendor/bin/smvc-create-controller-wizard`** is the interactive version of **`./vendor/bin/smvc-create-controller`**

* Ships with a very minimal amount of composer / packagists dependencies (all of which are used by **`Slim3MvcTools\Controllers\BaseController`**) in order to allow you to include only additional dependencies that suit the specific needs of your application. Thereby reducing the possibility of having unused / unneeded dependencies in your application

Expand Down
8 changes: 4 additions & 4 deletions documentation/MOVIE_CATALOG_APP_WALK_THROUGH.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ Next we are going to create some controller classes for our app by running
the commands below:

```
./vendor/bin/s3mvc-create-controller -c movie-catalog-base -p "./src" -n "MovieCatalog\Controllers" -e "\Slim3MvcTools\Controllers\BaseController"
./vendor/bin/s3mvc-create-controller -c users -p "./src" -n "MovieCatalog\Controllers" -e "\MovieCatalog\Controllers\MovieCatalogBase"
./vendor/bin/s3mvc-create-controller -c movie-listings -p "./src" -n "MovieCatalog\Controllers" -e "\MovieCatalog\Controllers\MovieCatalogBase"
./vendor/bin/s3mvc-create-controller -c http-not-allowed-not-found-server-error-handler -p "./src" -n "MovieCatalog\Controllers" -e "\MovieCatalog\Controllers\MovieCatalogBase"
./vendor/bin/smvc-create-controller -c movie-catalog-base -p "./src" -n "MovieCatalog\Controllers" -e "\Slim3MvcTools\Controllers\BaseController"
./vendor/bin/smvc-create-controller -c users -p "./src" -n "MovieCatalog\Controllers" -e "\MovieCatalog\Controllers\MovieCatalogBase"
./vendor/bin/smvc-create-controller -c movie-listings -p "./src" -n "MovieCatalog\Controllers" -e "\MovieCatalog\Controllers\MovieCatalogBase"
./vendor/bin/smvc-create-controller -c http-not-allowed-not-found-server-error-handler -p "./src" -n "MovieCatalog\Controllers" -e "\MovieCatalog\Controllers\MovieCatalogBase"
composer dumpautoload -o
```

Expand Down
8 changes: 4 additions & 4 deletions documentation/MVCFUNCTIONALITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Hello extends \Slim3MvcTools\Controllers\BaseController

### **More on Controllers and MVC Routes**
* Controller classes must extend `\Slim3MvcTools\Controllers\BaseController`. These classes must be named using studly case / caps e.g. **StaticPages**, **MobileDataProviders** and must be referenced in the controller segment of the url in all lowercases with dashes preceding capital case characters (except for the first capital case character). For example, `http://localhost:8888/mobile-data-providers/` will be responded to by the default action (defined via **`S3MVC_APP_DEFAULT_ACTION_NAME`**; default value is **`actionIndex`** ) method in the controller named **MobileDataProviders**, `http://localhost:8888/mobile-data-providers/list-providers` or `http://localhost:8888/mobile-data-providers/action-list-providers` (if **`S3MVC_APP_AUTO_PREPEND_ACTION_TO_ACTION_METHOD_NAMES`** is set to **`false`**) will be responded to by the **`actionListProviders()`** method in the controller named **`MobileDataProviders`**, etc.
* NOTE: there is a helper script available for creating Controller Classes and some default view files (see **`./vendor/bin/s3mvc-create-controller`** or **`./vendor/bin/s3mvc-create-controller-wizard`**)
* NOTE: there is a helper script available for creating Controller Classes and some default view files (see **`./vendor/bin/smvc-create-controller`** or **`./vendor/bin/smvc-create-controller-wizard`**)
* Controller action methods should be named using camel case (e.g. **`listProviders()`** ). In addition, they must be prefixed with the word **`action`** if **`S3MVC_APP_AUTO_PREPEND_ACTION_TO_ACTION_METHOD_NAMES`** is set to `true`; in this case **`actionListProviders()`**

* Action methods in Controller classes MUST either return a string (i.e. containing the output to display to the client) or an instance of **Psr\Http\Message\ResponseInterface** (e.g. $response, that has the output to be displayed to the client, injected into it via `$response->getBody()->write($data)` );
Expand Down Expand Up @@ -452,12 +452,12 @@ or `\Slim3MvcTools\Controllers\BaseController::renderView( $file_name, array $da
* Helper script for creating controller classes and a default index view:
* On *nix-like Oses
* `./vendor/bin/s3mvc-create-controller`
* `./vendor/bin/smvc-create-controller`
* On Windows
* `.\vendor\bin\s3mvc-create-controller.bat`
* `.\vendor\bin\smvc-create-controller.bat`
* NOTE: **`s3mvc-create-controller-wizard`** is the interactive version of the script above
* NOTE: **`smvc-create-controller-wizard`** is the interactive version of the script above
### S3MVC Helper Functions
Expand Down
4 changes: 2 additions & 2 deletions documentation/QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@

- Update the values of **S3MVC_APP_USE_MVC_ROUTES**, **S3MVC_APP_AUTO_PREPEND_ACTION_TO_ACTION_METHOD_NAMES**, **S3MVC_APP_DEFAULT_CONTROLLER_CLASS_NAME** and **S3MVC_APP_DEFAULT_ACTION_NAME** in **./public/index.php** to suit your needs.

- Start creating controllers for your application using **./vendor/bin/s3mvc-create-controller-wizard**
- Start creating controllers for your application using **./vendor/bin/smvc-create-controller-wizard**
> It is recommended that you first create a base controller for your application, which will contain all the logic that will be common to all your application's other controllers. The other controllers should extend your application's base controller.

> Make sure you add the namespace for your apps controller classes to the array referenced by **$container['namespaces_for_controllers']** in **./config/dependencies.php**
> Always run **composer dump** after each time your create a new controller class with **./vendor/bin/s3mvc-create-controller** or **./vendor/bin/s3mvc-create-controller-wizard**.
> Always run **composer dump** after each time your create a new controller class with **./vendor/bin/smvc-create-controller** or **./vendor/bin/smvc-create-controller-wizard**.

## Key Directories and Configuration
* **`config`:** Contains files for configuring the application
Expand Down
2 changes: 1 addition & 1 deletion src/views/base/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
<ul>
<li>
<strong>NOTE:</strong> there is a helper script available for creating Controller Classes and some default view files.
<br>See <strong><code>./vendor/bin/s3mvc-create-controller</code></strong> or <strong><code>./vendor/bin/s3mvc-create-controller-wizard</code></strong><br><br>
<br>See <strong><code>./vendor/bin/smvc-create-controller</code></strong> or <strong><code>./vendor/bin/smvc-create-controller-wizard</code></strong><br><br>
</li>

</ul>
Expand Down

0 comments on commit 9c9c5ea

Please sign in to comment.