SlideShare a Scribd company logo
Flyr – PHP micro framework
There are a lot of frameworks, each one with their particularities. There are really good
frameworks like laravel, codeigniter, cakephp, etc.
Flyr wants to be easy, simple and extensible. The goal is develop a fast micro-framework
which be so fast as user needs to develop applications.
Why try to remake validators, uploaders, orms and more software pieces if you can find
them in github with great quality and well tested?
Then you can add those libraries with a package manager like composer in your flyr
project.
Why another framework?
Flyr comes with a set of utilities:
- Router system with support for GET, POST, PUT and DELETE methods.
- Simple log component with email and file support.
- Http header manipulation.
- Cookies encryption.
- Simple cookie and session api.
- Easy multi-language component.
- Twig and php templates.
- Simple application skeleton for organize your project.
- Little mail sender support with PHPMailer.
What contains Flyr?
Installing flyr is as simple as creating a composer project or downloading the zip file inside
the flyr github REPOSITORY that contains all packages needed to run your application.
Run the following command to start a new project(at the current moment):
> composer create-project “flyr/flyr”:“1.0.*@dev”
Or simply download Flyr.zip in https://github.com/SiroDiaz/Flyr.
Now you have installed a copy of Flyr framework and you are ready to start developing.
How to install Flyr?
You can design a REST API easily using four request methods: GET, POST, PUT and DELETE.
Also, each route can contain parameters.
Finally you can pass a callback(anonym function) or the controller and method name. This
last option would be better for organize your project.
To resume this part you will see a few lines of code to understand better all refered to
routes.
Routes
Routes example
• Flyr also provides support for simple PHP templates (with tags <?php ?>) and Twig
template engine.
• You can render templates with the render method.
• But not only one template can be rendered for show in the browser, also you are able
to render multiple php or twig templates calling multiple times render method.
All templates are saved inside the folder app/views/ and all Twig templates are
automatically cached.
Views
Views example
For developing the REST of APIs you will need to return in your response body a data type
like JSON or XML and must be defined the response encoding as application/json or
text/xml for each data type.
You can set all response headers using the header->set method.
Maybe you need to remove headers like X-powered-by , redirect or send a response code.
It is simple and you can see the following examples using header object.
HTTP headers
HTTP headers example
Session and cookies have a new API for make many actions in the correct way like
deleting sessions and cookies, encrypting cookies or prevent cookie access from the
browser.
In the PHP cofiguration file (Flyr/Config/php_config.php) cookies and sessions are
correctly cofigured for avoid main source of session hijack.
Cookies methods are: create, delete, deleteAll, set, get.
Session methods are: start, set, get, delete, deleteAll.
You can see the following examples:
Managing sessions and cookies
Cookies and sessions example
Session example
Cookie example
Other important object is the flyr loader. You can load helpers and language files. Helpers
are files containing functions or classes to solve a specific group of problems. For example,
you can create a file called string_helper.php that has some functions to manipulate strings.
In the following example you can see how to load a language file containing the seven days
in Spanish:
Loader
Loading a language file example
A language file with an
associative array style
Loading the language file named ‘days.php’
inside the language folder ‘es’
Thanks
To know more about Flyr micro-
framework and read the full
documentation visit
https://github.com/SiroDiaz/Flyr
Fork and star the project

More Related Content

What's hot

Intro to flask
Intro to flaskIntro to flask
Intro to flask
Mohamed Essam
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
Mohamed Essam
 
Apache
ApacheApache
Apache
HAINIRMALRAJ
 
php basics
php basicsphp basics
php basics
NIRMAL FELIX
 
Php technical presentation
Php technical presentationPhp technical presentation
Php technical presentation
dharmendra kumar dhakar
 
PHP programmimg
PHP programmimgPHP programmimg
PHP programmimg
Sharbani Bhattacharya
 
Ruby Projects and Libraries
Ruby Projects and LibrariesRuby Projects and Libraries
Ruby Projects and Libraries
Vorleak Chy
 
Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009
John Clayton
 
CakePHP
CakePHPCakePHP
CakePHP
Walther Lalk
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)
Postman
 
Php Ppt
Php PptPhp Ppt
Php Ppt
Hema Prasanth
 
Laravel 6 and its features
Laravel 6 and its featuresLaravel 6 and its features
Laravel 6 and its features
SudabaSolaimankhil
 
Logging Services for .net - log4net
Logging Services for .net - log4netLogging Services for .net - log4net
Logging Services for .net - log4net
Guo Albert
 
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil ConferencePhalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
Jackson F. de A. Mafra
 
Javascript And CSS Libraries
Javascript And CSS LibrariesJavascript And CSS Libraries
Javascript And CSS Libraries
ProdigyView
 
PHP Conference - Phalcon hands-on
PHP Conference - Phalcon hands-onPHP Conference - Phalcon hands-on
PHP Conference - Phalcon hands-on
Jackson F. de A. Mafra
 
Flask
FlaskFlask
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently
postmanclient
 
Os Bubna
Os BubnaOs Bubna
Os Bubna
oscon2007
 
MySQL Presentation
MySQL PresentationMySQL Presentation
MySQL Presentation
Manish Bothra
 

What's hot (20)

Intro to flask
Intro to flaskIntro to flask
Intro to flask
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
 
Apache
ApacheApache
Apache
 
php basics
php basicsphp basics
php basics
 
Php technical presentation
Php technical presentationPhp technical presentation
Php technical presentation
 
PHP programmimg
PHP programmimgPHP programmimg
PHP programmimg
 
Ruby Projects and Libraries
Ruby Projects and LibrariesRuby Projects and Libraries
Ruby Projects and Libraries
 
Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009
 
CakePHP
CakePHPCakePHP
CakePHP
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
Laravel 6 and its features
Laravel 6 and its featuresLaravel 6 and its features
Laravel 6 and its features
 
Logging Services for .net - log4net
Logging Services for .net - log4netLogging Services for .net - log4net
Logging Services for .net - log4net
 
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil ConferencePhalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
 
Javascript And CSS Libraries
Javascript And CSS LibrariesJavascript And CSS Libraries
Javascript And CSS Libraries
 
PHP Conference - Phalcon hands-on
PHP Conference - Phalcon hands-onPHP Conference - Phalcon hands-on
PHP Conference - Phalcon hands-on
 
Flask
FlaskFlask
Flask
 
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently
 
Os Bubna
Os BubnaOs Bubna
Os Bubna
 
MySQL Presentation
MySQL PresentationMySQL Presentation
MySQL Presentation
 

Viewers also liked

Proyecto educativo lectura y tic
Proyecto educativo lectura y ticProyecto educativo lectura y tic
Proyecto educativo lectura y tic
jackelin chincha
 
Presentacion croquis
Presentacion croquisPresentacion croquis
Presentacion croquis
David Calderon
 
Fluid - Templating for professionals - T3CON09
Fluid - Templating for professionals - T3CON09Fluid - Templating for professionals - T3CON09
Fluid - Templating for professionals - T3CON09
Sebastian Kurfürst
 
Avatar Minihompy Proposal
Avatar Minihompy ProposalAvatar Minihompy Proposal
Avatar Minihompy Proposal
Jeongha Lee
 
Liceo Pedagógico Maria Reina de la Paz
Liceo Pedagógico Maria Reina de la PazLiceo Pedagógico Maria Reina de la Paz
Liceo Pedagógico Maria Reina de la Paz
Sniper Ltda.
 
el Punto SIGRE
el Punto SIGREel Punto SIGRE
Fortum in India
Fortum in IndiaFortum in India
Fortum in India
Business Finland
 
Red Logica
Red LogicaRed Logica
Red Logica
guest83a177f
 
Kotler pom 15e_inppt_09
Kotler pom 15e_inppt_09Kotler pom 15e_inppt_09
Kotler pom 15e_inppt_09
Deden As-Syafei
 
Lineamientos para el uso y aplicacion de los recursos educativos digitales
Lineamientos para el uso y aplicacion de los recursos educativos digitalesLineamientos para el uso y aplicacion de los recursos educativos digitales
Lineamientos para el uso y aplicacion de los recursos educativos digitales
Carlos Alzate
 
36th auction for old stocks ands bonds / Scripophily / Historische Wertpapier...
36th auction for old stocks ands bonds / Scripophily / Historische Wertpapier...36th auction for old stocks ands bonds / Scripophily / Historische Wertpapier...
36th auction for old stocks ands bonds / Scripophily / Historische Wertpapier...
Matthias Schmitt
 
2013 july gac webinar for tom
2013 july gac webinar for tom2013 july gac webinar for tom
2013 july gac webinar for tom
DNS Entrepreneurship Center
 
Apnea pulmon
Apnea pulmonApnea pulmon
Marketing de atracción 2.0 (Inbound Marketing) - Oscar del Santo y Daniel Álv...
Marketing de atracción 2.0 (Inbound Marketing) - Oscar del Santo y Daniel Álv...Marketing de atracción 2.0 (Inbound Marketing) - Oscar del Santo y Daniel Álv...
Marketing de atracción 2.0 (Inbound Marketing) - Oscar del Santo y Daniel Álv...
Juan Carlos Mejía Llano
 
Pelan Hebat Produk Hebat e-naco
Pelan Hebat Produk Hebat e-nacoPelan Hebat Produk Hebat e-naco
Pelan Hebat Produk Hebat e-naco
Success Profile
 
Modelos de investigación cualitativa y cuantitativa
Modelos de investigación cualitativa y cuantitativaModelos de investigación cualitativa y cuantitativa
Modelos de investigación cualitativa y cuantitativa
Raah Yhwh
 
96084535 informe-final-serums
96084535 informe-final-serums96084535 informe-final-serums
96084535 informe-final-serums
roxana diaz cisneros
 
Gymkana los derechos del niño
Gymkana los derechos del niñoGymkana los derechos del niño
Gymkana los derechos del niño
Alfonso Peña Sánchez
 
Funciones mentales superiores 4 to trimestre psicologia
Funciones mentales superiores 4 to trimestre psicologiaFunciones mentales superiores 4 to trimestre psicologia
Funciones mentales superiores 4 to trimestre psicologia
UBA
 
Bob Dylan on Creativity
Bob Dylan on CreativityBob Dylan on Creativity
Bob Dylan on Creativity
Chris Landry
 

Viewers also liked (20)

Proyecto educativo lectura y tic
Proyecto educativo lectura y ticProyecto educativo lectura y tic
Proyecto educativo lectura y tic
 
Presentacion croquis
Presentacion croquisPresentacion croquis
Presentacion croquis
 
Fluid - Templating for professionals - T3CON09
Fluid - Templating for professionals - T3CON09Fluid - Templating for professionals - T3CON09
Fluid - Templating for professionals - T3CON09
 
Avatar Minihompy Proposal
Avatar Minihompy ProposalAvatar Minihompy Proposal
Avatar Minihompy Proposal
 
Liceo Pedagógico Maria Reina de la Paz
Liceo Pedagógico Maria Reina de la PazLiceo Pedagógico Maria Reina de la Paz
Liceo Pedagógico Maria Reina de la Paz
 
el Punto SIGRE
el Punto SIGREel Punto SIGRE
el Punto SIGRE
 
Fortum in India
Fortum in IndiaFortum in India
Fortum in India
 
Red Logica
Red LogicaRed Logica
Red Logica
 
Kotler pom 15e_inppt_09
Kotler pom 15e_inppt_09Kotler pom 15e_inppt_09
Kotler pom 15e_inppt_09
 
Lineamientos para el uso y aplicacion de los recursos educativos digitales
Lineamientos para el uso y aplicacion de los recursos educativos digitalesLineamientos para el uso y aplicacion de los recursos educativos digitales
Lineamientos para el uso y aplicacion de los recursos educativos digitales
 
36th auction for old stocks ands bonds / Scripophily / Historische Wertpapier...
36th auction for old stocks ands bonds / Scripophily / Historische Wertpapier...36th auction for old stocks ands bonds / Scripophily / Historische Wertpapier...
36th auction for old stocks ands bonds / Scripophily / Historische Wertpapier...
 
2013 july gac webinar for tom
2013 july gac webinar for tom2013 july gac webinar for tom
2013 july gac webinar for tom
 
Apnea pulmon
Apnea pulmonApnea pulmon
Apnea pulmon
 
Marketing de atracción 2.0 (Inbound Marketing) - Oscar del Santo y Daniel Álv...
Marketing de atracción 2.0 (Inbound Marketing) - Oscar del Santo y Daniel Álv...Marketing de atracción 2.0 (Inbound Marketing) - Oscar del Santo y Daniel Álv...
Marketing de atracción 2.0 (Inbound Marketing) - Oscar del Santo y Daniel Álv...
 
Pelan Hebat Produk Hebat e-naco
Pelan Hebat Produk Hebat e-nacoPelan Hebat Produk Hebat e-naco
Pelan Hebat Produk Hebat e-naco
 
Modelos de investigación cualitativa y cuantitativa
Modelos de investigación cualitativa y cuantitativaModelos de investigación cualitativa y cuantitativa
Modelos de investigación cualitativa y cuantitativa
 
96084535 informe-final-serums
96084535 informe-final-serums96084535 informe-final-serums
96084535 informe-final-serums
 
Gymkana los derechos del niño
Gymkana los derechos del niñoGymkana los derechos del niño
Gymkana los derechos del niño
 
Funciones mentales superiores 4 to trimestre psicologia
Funciones mentales superiores 4 to trimestre psicologiaFunciones mentales superiores 4 to trimestre psicologia
Funciones mentales superiores 4 to trimestre psicologia
 
Bob Dylan on Creativity
Bob Dylan on CreativityBob Dylan on Creativity
Bob Dylan on Creativity
 

Similar to Flyr PHP micro-framework

Cakephp manual-11
Cakephp manual-11Cakephp manual-11
Cakephp manual-11
Aditya Pandey
 
CONTENT MANAGEMENT SYSTEM
CONTENT MANAGEMENT SYSTEMCONTENT MANAGEMENT SYSTEM
CONTENT MANAGEMENT SYSTEM
ANAND PRAKASH
 
Unit 1
Unit 1Unit 1
Php tutorial
Php tutorialPhp tutorial
Php tutorial
sushil kumar
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
Nguyễn Hoà
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
vigneswaran54
 
How PHP works
How PHP works How PHP works
Php
PhpPhp
Php tutorial
Php tutorialPhp tutorial
Php tutorial
Niit
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
Roohul Amin
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
Sleepy Head
 
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
Francois Zaninotto
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
burasyacob012
 
Php&amp;yii2
Php&amp;yii2Php&amp;yii2
Php&amp;yii2
RakhiBhojwani
 
Introduction to Cakephp
Introduction to CakephpIntroduction to Cakephp
Introduction to Cakephp
Aditya Mooley
 
PHP.docx
PHP.docxPHP.docx
PHP.docx
NithiyaNithi2
 
cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)
Varsha Krishna
 

Similar to Flyr PHP micro-framework (20)

Cakephp manual-11
Cakephp manual-11Cakephp manual-11
Cakephp manual-11
 
CONTENT MANAGEMENT SYSTEM
CONTENT MANAGEMENT SYSTEMCONTENT MANAGEMENT SYSTEM
CONTENT MANAGEMENT SYSTEM
 
Unit 1
Unit 1Unit 1
Unit 1
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
How PHP works
How PHP works How PHP works
How PHP works
 
Php
PhpPhp
Php
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
 
Php&amp;yii2
Php&amp;yii2Php&amp;yii2
Php&amp;yii2
 
Introduction to Cakephp
Introduction to CakephpIntroduction to Cakephp
Introduction to Cakephp
 
PHP.docx
PHP.docxPHP.docx
PHP.docx
 
cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)
 

Recently uploaded

SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
Ayan Halder
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 

Recently uploaded (20)

SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 

Flyr PHP micro-framework

  • 1. Flyr – PHP micro framework
  • 2. There are a lot of frameworks, each one with their particularities. There are really good frameworks like laravel, codeigniter, cakephp, etc. Flyr wants to be easy, simple and extensible. The goal is develop a fast micro-framework which be so fast as user needs to develop applications. Why try to remake validators, uploaders, orms and more software pieces if you can find them in github with great quality and well tested? Then you can add those libraries with a package manager like composer in your flyr project. Why another framework?
  • 3. Flyr comes with a set of utilities: - Router system with support for GET, POST, PUT and DELETE methods. - Simple log component with email and file support. - Http header manipulation. - Cookies encryption. - Simple cookie and session api. - Easy multi-language component. - Twig and php templates. - Simple application skeleton for organize your project. - Little mail sender support with PHPMailer. What contains Flyr?
  • 4. Installing flyr is as simple as creating a composer project or downloading the zip file inside the flyr github REPOSITORY that contains all packages needed to run your application. Run the following command to start a new project(at the current moment): > composer create-project “flyr/flyr”:“1.0.*@dev” Or simply download Flyr.zip in https://github.com/SiroDiaz/Flyr. Now you have installed a copy of Flyr framework and you are ready to start developing. How to install Flyr?
  • 5. You can design a REST API easily using four request methods: GET, POST, PUT and DELETE. Also, each route can contain parameters. Finally you can pass a callback(anonym function) or the controller and method name. This last option would be better for organize your project. To resume this part you will see a few lines of code to understand better all refered to routes. Routes
  • 7. • Flyr also provides support for simple PHP templates (with tags <?php ?>) and Twig template engine. • You can render templates with the render method. • But not only one template can be rendered for show in the browser, also you are able to render multiple php or twig templates calling multiple times render method. All templates are saved inside the folder app/views/ and all Twig templates are automatically cached. Views
  • 9. For developing the REST of APIs you will need to return in your response body a data type like JSON or XML and must be defined the response encoding as application/json or text/xml for each data type. You can set all response headers using the header->set method. Maybe you need to remove headers like X-powered-by , redirect or send a response code. It is simple and you can see the following examples using header object. HTTP headers
  • 11. Session and cookies have a new API for make many actions in the correct way like deleting sessions and cookies, encrypting cookies or prevent cookie access from the browser. In the PHP cofiguration file (Flyr/Config/php_config.php) cookies and sessions are correctly cofigured for avoid main source of session hijack. Cookies methods are: create, delete, deleteAll, set, get. Session methods are: start, set, get, delete, deleteAll. You can see the following examples: Managing sessions and cookies
  • 12. Cookies and sessions example Session example Cookie example
  • 13. Other important object is the flyr loader. You can load helpers and language files. Helpers are files containing functions or classes to solve a specific group of problems. For example, you can create a file called string_helper.php that has some functions to manipulate strings. In the following example you can see how to load a language file containing the seven days in Spanish: Loader
  • 14. Loading a language file example A language file with an associative array style Loading the language file named ‘days.php’ inside the language folder ‘es’
  • 15. Thanks To know more about Flyr micro- framework and read the full documentation visit https://github.com/SiroDiaz/Flyr Fork and star the project