Followings are some of useful code snippets of Laravel: 1). Show validation errors in view: @if($errors->has()) @foreach ($errors->all() as $error) <div>{{ $error }}</div> @endforeach @endif 2) Prevent errors by using the optional helper: When accessing object values, if that object is null, your code will raise an error. A simple way of avoiding errors is … Continue reading Laravel Helpful Code Snippets
Category: PHP Frameworks
A PHP framework provides the basic structure and components to build web applications.
What is FuelPHP FuelPHP is an open source web application framework. It is written in PHP 5.3 and implements HMVC pattern. HMVC is Hierarchical Model-View-Controller framework that allows to sub-request the controller, which returns the partial page such as comments, menus, etc., instead of the complete page as in normal MVC. FuelPHP is developed by … Continue reading FuelPHP Introduction
What is Slim Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs. PHP developers use Slim to develop RESTful APIs and web services.Key features include URL routing, session, and cookie encryption, client-side HTTP caching, and more. It’s the best framework for a small web application that … Continue reading Slim Introduction
If you found laravel project from github.com and you want to setup and use it locally, following are some helpful steps: Clone your projectGo to the folder application using cd command on your cmd or terminalRun composer install on your cmd or terminalCopy .env.example file to .env on the root folder. You can type copy … Continue reading How to install laravel project cloned from github
What is Middleware In Laravel, Middleware is the mechanism to apply any type of filtering you may need to HTTP requests to your application. Middleware works between request and response of our application.It sits between Request and Response like a firewall that examine whether to route a request.Laravel comes with several inbuilt middlewares like EncryptCookies … Continue reading Laravel Middleware
What is Phalcon: Phalcon is an open-source framework of PHP programming language. It is based on Module View Controller (MVC) pattern. Phalcon is the first framework that implements ORM in C-programming language. It is a combination of PHP and C language. Phalcon is developed by Andres Gutierrez and his group of collaborators. Phalcon is highly … Continue reading Phalcon Introduction
Laravel Route is a way of creating a request URL of your application. These URL do not have to map to specific files on a website. The best thing about these URL is that they are both human readable and SEO friendly. Routing is a core concept in Laravel, and it works a little differently … Continue reading Laravel Routing
What is Ruby on Rails Ruby on Rails (or just “Rails” for short) is a server-side web application development framework written in Ruby language by David Heinemeier Hansson. It allows you to write less code than other languages and frameworks. Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl … Continue reading Ruby on Rails Introduction
To remove index.php from url, please use following steps: 1. Open the file config.php located in application/config path. Find and Replace the below code in config.php file. // Find the below code $config['index_page'] = "index.php" // Remove index.php $config['index_page'] = "" 2. Go to codeigniter application root follow and create .htaccess file. 3. Write following code in … Continue reading Codeigniter Remove index.php from URL
In This Tutorial, We learn how to install CodeIgniter . Followings are steps to install Codeigniter: Step 1: Download Codeigniter from https://codeigniter.com/download. There are two different options legacy and latest. The names itself are self descriptive. legacy has version less than 2.x and latest has 3.0 version. Step 2: Next step is to unzip the … Continue reading Codeigniter Installation