Download the PHP package rceman/copper without Composer
On this page you can find all versions of the php package rceman/copper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rceman/copper
More information about rceman/copper
Files in rceman/copper
Informations about the package copper
Copper is a PHP Framework that is mainly focused on simplicity and development speed
Versions:
- v1.0 - https://github.com/therceman/copper/tree/v1.0.13
- v2.0 (master) - https://github.com/therceman/copper (Work In Progress, No Manual/Readme/Documentation yet)
Developed and Maintained by Anton (therceman) - Web Developer and Security Researcher / Bug Bounty Hunter
Documentation For v1.0
See The Copper Skeleton for a minimal and empty Copper v1.0 app which you can base your new apps on
Installation
Folder Structure
Configuration (Getting Started)
create file /public/index.php
create file /public/.htaccess
Configuration (Advanced)
update file /composer.json
run console command
create file /templates/index.php
create file /src/Controller/HomeController.php
create afile /config/routes.php
Configuration (Optional)
create file /.gitignore
Framework modules
- Routes config module (using config/routes.php)
- Controller module (using Controller/*Controller.php)
- View (Templating) module (using templates/*.php)
Routes config module :: Classes
Classes
- [RoutingConfigurator] (Symfony) - Routing Configurator
- Instances
$routes
- default instance- Methods (basic)
->add($name, $path)
- Adds a route.->controller($controller)
- Adds controller to a route.->methods($methods)
- Sets the HTTP methods (e.g.'POST'
) this route is restricted to->requirements($requirements)
- Adds route requirements (e.g.['page' => '\d+']
)->defaults($defaults)
- Adds route defaults (e.g.['page' => 1]
)
View (Templating) module :: Variables, Methods and Classes
Variables
$view->request_method
- Request method GET or POST$view->request_uri
- Request uri$view->client_ip
- Client's IP address$view->controller_name
- Controller name$view->route_name
- Route nameMethods
$view->routeBag->get($key, $default = null)
- Route parameter by key$view->postBag->get($key, $default = null)
- POST parameter by key$view->queryBag->get($key, $default = null)
- GET parameter by key$view->cookiesBag->get($key, $default = null)
- Cookies parameter by key$view->dataBag->get($key, $default = null)
- Template parameter by key$view->out($value)
- Escape HTML code and output as string$view->out($array)
- Escape HTML code and output as formatted array$view->render($template)
- Render template$view->relativePath($name, $parameters = [])
- Returns the relative Path to named route$view->networkPath($name, $parameters = [])
- Returns the network Path to named route$view->url($name, $parameters = [], $withScheme = false)
- Returns the URL to named routeClasses
- [ViewOutput] - Output processor (escape, format, etc.)
- Instances
$view->output
- default instance- Methods
->raw($value)
- Output as string (no escape)->js($value)
- Escape Javascript code and output as string->json($array)
- Format Array as JSON string (no escape)->text($value)
- Escape HTML code and output as string->dump($array)
- Escape HTML code and output as formatted array
- [ParameterBag] (Symfony) - Collection of Request parameters
- Instances
$view->routeBag
- Route parameters (iterable)$view->postBag
- POST parameters (iterable)$view->queryBag
- GET parameters (iterable)$view->cookiesBag
- Cookies parameters (iterable)$view->dataBag
- Template parameters (iterable)- Methods (basic)
->all()
- Returns an array with parameters->get($key)
- Returns a parameter by name->set($key, $value)
- Sets a parameter by name->has($key)
- Returns true if the parameter is defined->remove($key)
- Removes a parameter->getInt($key, $default = 0)
- Returns the parameter value converted to integer->getBoolean($key, $default = false)
- Returns the parameter value converted to boolean
Controller module :: Methods and Classes
Methods
$this->viewResponse($view, $parameters = [])
- Returns a Response with rendered view$this->renderView($view, $parameters = [])
- Returns a rendered view$this->response($data, $status = 200, $headers = [])
- Returns a HTTP Response$this->json($data, $status = 200, $headers = [])
- Returns a JsonResponse that uses json_encode$this->redirectToRoute($route, $parameters = [], $status = 302)
- Returns a RedirectResponse to the given route$this->redirect($url, $status = 302)
- Returns a RedirectResponse to the given URLClasses
- [Request] (Symfony) - Request represents an HTTP request
- Instances
$this->request
- default instance
- [RequestContext] (Symfony) - Holds information about the current request
- Instances
$this->requestContext
- default instance
- [RouteCollection] (Symfony) - A RouteCollection represents a set of Route instances
- Instances
$this->routes
- default instance
All versions of copper with dependencies
ext-json Version *
symfony/http-foundation Version 3.4.35
symfony/routing Version 3.4
symfony/config Version 3.4