meow / core
Meow core library
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/meow/core
Requires
- meow/di: ^0.1.1
- meowphp/routing: ^0.1.0
README
namespace: Meow\Core
Base for web applications. This is wrapper arround meow\di and meow\router. On top of it, it contains also functionality for reading configuration from arrays
Installation
To instal this one use following command
composer require meow/core
Creating new application
Create new application by creating new instance of Meow\Core\Application
require '../config/paths.php'; $app = new \Meow\Core\Application();
By default application will look for configuration and register new routes and services from application.php file in CONFIG folder. Here is example of that config file:
return [ /** * Register your application's controller here, this are used for configuring routes */ 'Controllers' => [ \May\AttributesTest\MainController::class, \May\AttributesTest\Controllers\ExampleController::class ], /** * Application Services */ 'Services' => [ /** * Application services */ \Meow\AttributesTest\Database\DatabaseServiceProviderInterface::class => \Meow\AttributesTest\Database\DatabaseServiceProvider::class, ], //... more configuration ];
Getting result from controller
This is what you congroller returns. To get the controller from uri you can do this:
if (!isset($_SERVER['PATH_INFO'])) { $request_uri = '/'; } else { $request_uri = $_SERVER['PATH_INFO']; } $result = $app->callController($request_uri); // controllers should return string
License: MIT