Download the PHP package selikhovleonid/nadir without Composer

On this page you can find all versions of the php package selikhovleonid/nadir. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nadir

Nadir

Yet Another PHP Microframework.

Latest Stable Version Latest Unstable Version License PHP from Packagist

Nadir is a PHP microframework which helps you quickly write web applications, console applications and RESTful services. It's based on the MVC pattern. This microframework provides wide opportunities for modification and customization.

  1. Installing
  2. Project structure
  3. Main configuration file
  4. Controller
  5. View
  6. Model
  7. Authorization
  8. Data validation

Installing

The minimum required PHP version of Nadir is PHP 5.3. You will need Composer dependency manager to install this microframework. The easiest way to start working with Nadir is to create project skeleton running the following shell command:

Project structure

The created project template will have a structure simular to this:

Main configuration file

The configuration of any application (console or web) is contained in the file /config/main.php. This is an associative array that is read when the microframework core is loaded. The array is available for modification and extension and includes the following elements by default:

Access to the configurations within the client code is done by calling the

Controller

The controller is an instance of a class inherited from the \nadir\core\AbstractWebController or the \nadir\core\AbstractCliController abstract superclasses. When called, the controller performs some action, which usually refers to the model for the purpose of obtaining data, their further conversion and pass to the view.

Controller and view

In the lifetime of the web application, after the query binding with the Controller-Action pair, a controller object is created, which by default tries to associate the view objects with it.

The view is generally composite and consists of a Layout (an instance of the class \nadir\core\Layout) and View in a narrow sense (object of the class \nadir\core\View). Defaulted view objects are assigned only if there are associated markup files. The name of the markup file is obtained by discarding the 'action' prefix from the action name, the file is placed in the directory with the controller name (file names and directories should be in lowercase).

View objects are available within the controller by calling the accessors $this->getView(), $this->setView(), $this->getLayout() and $this->setLayout(). At any time prior to the beginning of page rendering, it's possible to change the default Layout or View to any other available single-type object.

Passing values of user variables from the controller to the view:

In the markup file /views/views/test/default.php of this view the variables are readable by calling $this->foo, $this->bar, $this->baz and so on.

The page is rendered by calling $this->render() within the action. You can render a page containing only the View file (it's clear that Layout in this case must be null). Moreover, in case of AJAX-request HTML-page rendering is often not needed at all, a more specific answer format is required, in this case the \nadir\core\AbstractWebCtrl::renderJson() method is provided.

CLI controller

The example of shell command:

This command after the query binding according route table will be processed by the CLI controller action:

View

Composite view

The view contains HTML-code and a minimum of logic, which is necessary only for operating variables received from the controller. The view is generally composite and consists of a Layout (an instance of the class \nadir\core\Layout) and View in a narrow sense (object of the class \nadir\core\View).

Each of the composites of the view can in turn contain snippets (objects of the \nadir\core\Snippet class) - fragments of the frequently encountered elements of the interface - navigation panels, various information blocks, etc.

In the markup file /views/views/test/default.php of this View variables are readable by calling $this->foo and $this->bar.

Similarly, in the markup file /views/layouts/main.php of the Layout, the variable is readable by calling $this->isUserOnline

Pay attention that the rendering of the View in Layout is determined by the location of the method call $this->getView()->render().

Snippets

Working with snippets, in general, is similar to working with Composites - View and Layout. The class of the snippet is also inherits the class \nadir\core\AbstractView and the process of sending and calling user variables is similar to that of the Layout and View. Composites can contain more than one snippet. The snippet can't include another snippet.

We will take the part of the markup from the previous example into the separate snippet topbar. The file /views/snippets/topbar.php will contain the following code:

The controller action will look like this:

The rendering of the snippet topbar in View is determined by the location of the method call $this->getSnippet('topbar')->render().

Model

Nadir doesn't contain certain rules and regulations for building a model. The concrete implementation of this component of the MVC pattern is given to the developer. Depending on many factors, the model can be represented as one layer (single object), and several levels of abstraction (a complex hierarchy of associated objects).

Authorization

Nadir provides a wide range of customization options for user authorization. It's necessary to fill the \extensions\core\Auth class with a concrete functional for this.

To realize role based access control you should also make additional options in routes in the main configuration file.

Data validation

The class nadir\core\validator\Validator provides the validation of input data. Its functionality can be extended by adding new custom validation rules.


All versions of nadir with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package selikhovleonid/nadir contains the following files

Loading the files please wait ....