Download the PHP package luismoralesp/primal without Composer

On this page you can find all versions of the php package luismoralesp/primal. 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 primal

primal-php

Primal it's a PHP framework for Restful service.

Install

Install using composer

composer.json

{
  "require": {
    "luismoralesp/primal": "1.0.5"
  }
}

Get Started

The first stpep for use Primal is star a new proyect, we will use the bellow command:

$ php /vendor/luismoralesp/primal/install.php 
$ php manage.php startapp myapp

Then we will have a new folder structure:

myapp folder is our proyect folder inside it we will found the models folder where we will put our models class files and views folder where we will put our view class files, by default a file class was createt with our project the name but with first word uppercase this important for this framework.

Inside the file we will found the bellow code:

and finally a file in the root, named index.php, here we will found the our project configuration routing, by default we will found this code:

With the parameter in de Router::getInstance(default_rouing) will set the path to the serive method in the view file, using the bello format:

[app_name].[view_file].[method_name]

So, if we invoke / or /hi/ in the web browser We will recive:

Creating a model

A model reprecent directly a table in the data base, the model is an interface for manipulate each database table.

For define an model we will need to create a class with the same name that our table and extends it from base class Model.

Each model need belong to an app, for this we must to use:

Kernel::package(package_name);

So in our class file we have to define our fields and contrains.

For use that model class in our view file we will have to import it, using the bellow line:

Kernel::import('app.MyModel ');

Then we can use the model in our view, for example calling a filter method, it we will return all rows in our table for this model:

MyModel::persistence()->filter();

Then we will to have a view file like this:


All versions of primal with dependencies

PHP Build Version
Package Version
Requires php Version ^5.3.3 || ^7.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 luismoralesp/primal contains the following files

Loading the files please wait ....