News

Featured 21 Jul
CodeIgniter vs Laravel
CodeIgniter vs Laravel

CodeIgniter and Laravel are a very popular and simple PHP framework with a large community and training. In this article, we plan to learn one of these two popular platforms.

In this article, we intend to provide a comprehensive and varied range of these two formats to make it easier for you to know the proper framework.

Learn more about CodeIgniter and Laravel
CodeIgniter is a robust and powerful PHP designed for programmers who are looking for a simple, structured suite of applications to develop and design web applications. CodeIgniter has been the preferred choice for many years.

One of the design goals of this framework is to simplify learning for novice programmers and to make development projects faster than other frameworks. It also provides a rich collection of libraries alongside user interface and logic (for access to libraries).

Compare the three Laravel and Symfony and Yii frames

Laravel also has a PHP framework that is available to users for the first time in 2011. Since then, this framework has gained a lot of popularity and was used in a large number of web applications. Laravel is designed with the latest version of PHP and many components such as support for authentication and unit testing.

Both frameworks have unique features and are flexible for web application programmers. When choosing one of the frameworks for website development, consider the key differences between these frames.

Comprehensive Introduction to Frameworks

Positive features and Wi-Fi details
Trusted by a large community

CodeIgniter has been the preferred developer for many years to come. A large community of CodeIgniter platforms is used to develop web applications from small to large levels.

CodeIgniter is a trustworthy user-friendly file system. Thanks to the large community of this framework, getting online help and support is easy.

Documentation (Documentation)

In this case, CodeIgniter is among other frameworks. CodeIgniter coding is very clear and customizable. As a developer, it's hard to understand. The structure of this documentation is simple to learn, and the custom features (custom) have also been added.

Simple, Bright, Fast

CodeIgniter is a framework that is very fast to use. People who are familiar with PHP can launch CodeIgniter framework coding and begin to develop their own software.

Even if you have little or no architecture with MVC, this framework will be easy for you.

This framework at the base requires only the library (library) number. Additional libraries can be loaded as needed, but the system base is very simple.

CodIgniter is known for its speed. Website CodeIgniter can be:

We challenge you to find a framework that is more efficient than CodeIgniter.

High security, tested by millions of users

CodeIgniter has been tested by millions of users for many years. With a large number of people using this system, this system should be safe. In the area of ​​security, the CodeIgniter framework has been very successful.

Embedded internal features and components

CodeIgniter has a number of internal standard standards. Here's a list of some of the most commonly used features:

Templating Engine: The CodeIgniter Framework is a simple parser template that is easy to use. To work with CodeIgniter, you do not need to install a separate engine template.
Output Caching: The CodeIgniter framework also provides storage in bread memory. Web pages are stored so download time is reduced. This feature increases productivity and performance.
Query Builder database support: The CodeIgniter framework has a built-in query class built-in internal structure. This class allows data in the database to be retrieved, copied, updated and updated with the minimum script code. For its simple interface, to run a query database operation, we sometimes only need to write 3-2 lines of code.
Database Case: CodeIgniter stores database queries in text, which reduces database load.
Test Unit Class: The CodeIgniter framework for testing the unit provides an application for unit testing management, and also provides a class of Test Unit that is quite simple and comes with a functional evaluation and two result results.
Data encryption: CodeIgniter provides two ways to encrypt data and supports the Mcrypt PHP extension that is required to run the Encrypt class.
Positive features and Laravel's disadvantages
Popularity

Laravel is still a new framework, but has gained significant success in the Sourceries market shortly. Also, Laravel has been winning for the unique capabilities of the Sitepoint Survey award for the best PHP 2015 framework.

Supports the latest version of PHP

Laravel is built for the latest PHP version. Laravel is often updated and operative

Readmore
Featured 08 Jul
Android Webserver
Android Webserver

اندروید وب سرور

شما می‌توانید با مطالعه این آموزش کوتاه،

گوشی تلفن همراه هوشمند خود را به یک وب سرور تبدیل کنید.

اگر می‌خواهید گوشی هوشمند خود را به وب سرور (web server) تبدیل کنید، با این آموزش ساده در لیداوب همراه باشید تا به شما نشان دهیم که چگونه با ترفندی ساده، می‌توانید این کار را انجام دهید.

پیش از هر چیز باید به این نکته توجه داشته باشید که این آزمایش فقط روی “Iris web framework” تست و اجرا شده و در “golang” و اندروید ورژن 5.1 نوشته شده است.

android web server | تبدیل گوشی تلفن همراه به web server

مراحل انجام کار

گوشی تلفن همراه خود را روشن کنید و مراحل زیر را انجام دهید.

  1. برنامه Termux را دانلود کرده و روی گوشی خود نصب کنید.
  2. حالا Termux را اجرا کنید
  3. دستوراتی که در زیر نوشته شده را به ترتیب در برنامه اجرا کنید
$ pkg install git

$ pkg install golang

$ export GOPATH=/data/data/com.termux/files/home/go

$ go get -u -v github.com/kataras/iris

$ cd /data/data/com.termux/files/home/go/src/github.com/kataras/iris/_examples/hello-world

$ go run main.go

 حالا مرورگر گوشی تلفن همراه خود را باز کنید و آدرس زیر را در مرورگر وارد کنید:

http://localhost:8080 

به همین سادگی کار تبدیل تلفن همراه به وب سرور به پایان رسید و شما می‌توانید از تلفن خود به عنوان یک وب سرور اندروید استفاده کنید.

خوشحال می‌شویم اگر نظری درباره این پست دارید،یا روش دیگری برای انجام این کار می‌شناسید، در قسمت نظرات با ما در میان بگذارید.

Readmore
Featured 27 Mar
Laravel File Manager
Laravel File Manager

Laravel File Manager Integration

In this tutorial:

we will go over the setup of a useful Laravel UniSharp File Manager for content areas that are used mostly for custom Content Management Systems, or any application that may need a text editor to perform common tasks and file image uploading, these days nobody uses just plain text area for an application, unless its used for a meta description field or short summary, for content it is better to use a featured WYSIWYG editor to provide a better user experience. We will be looking at a fully working demo application at Task MGMT that you can try and see how the final result, also discuss how you can achieve the same for your own personal projects.

Note: I will assume you already installed Laravel, can run php artisan commands and have a working Laravel installation. The running demo is using Laravel 5.5

File Manager Requirements

  • php >= 5.4
  • exif extension
  • fileinfo extension
  • GD Library >=2.0 or Imagick PHP extension >=6.5.7
  • Laravel 5
  • requires intervention/image (to make thumbs, crop and resize images).

File Manager Installation

Open up your terminal or command prompt and enter in the root of your project directory:
Step 1: install package

1
composer require unisharp/laravel-filemanager:~1.8

If you are running Laravel 5.5, ignore step 2 below, and go to step 3 instead.
Step 2: add to providers and aliases arrays
Once the package is installed open config/app.php and add these 2 lines to the end of the providers array

1
2
3
4
5
'providers' => [
    ...    
    UnisharpLaravelfilemanagerLaravelFilemanagerServiceProvider::class,
    InterventionImageImageServiceProvider::class,
],

Next, in the same config/app.php file, add the following line in the aliases array:

1
2
3
4
'aliases' => [
    ... 
    'Image' => InterventionImageFacadesImage::class,
],

Step 3: Publish and clear package
Enter the following php artisan commands

1
2
3
4
php artisan vendor:publish --tag=lfm_config
php artisan vendor:publish --tag=lfm_public
php artisan route:clear
php artisan config:clear

Step 4: Config/Create directories
Open config/lfm.php
Note the following:

1
2
3
4
5
6
7
    'base_directory' => 'public',
 
    'images_folder_name' => 'photos',
    'files_folder_name'  => 'files',
 
    'shared_folder_name' => 'shares',
    'thumb_folder_name'  => 'thumbs',

Ensure these are writable by your web server

WYSIWYG Editor Integration

Now that we have the required packages, lets make use of this File Manager, i will be using TinyMCE4, you can find information on how to setup other WYSIWYG editors such as CKEditor, Summernote.

In order to focus on the most important aspects of this topic, certain parts will be removed, fields that we dont need so we concentrate only on a few fields, with the content editor being the most important one.
The full source code can be found here

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
@extends('layout')
 
@section('content')
 
@include('includes.errors') 
 
<form id="task_form" action="{{ route('task.store') }}" method="POST" enctype="multipart/form-data">
    {{ csrf_field() }}
 
    <div class="col-md-12">
        <label>Create new task <span class="glyphicon glyphicon-plus" aria-hidden="true"></span></label>
 
        <div class="form-group">
            <input type="text" class="form-control" placeholder="Enter Task Title" name="task_title">
        </div>
 
        <div class="form-group">
            <textarea class="form-control my-editor" rows="10" id="task" name="task"></textarea>
        </div>
 
        <div class="btn-group">
            <input class="btn btn-primary" type="submit" value="Submit">
            <a class="btn btn-default" href="{{ redirect()->getUrlGenerator()->previous() }}">Back</a>
        </div>
 
    </div>
 
</form>
 
@stop
 
 
@section('scripts') 
 
    <script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
 
    <script>
      var editor_config = {
        // path_absolute : "/",
        path_absolute:"{{ url('/') }}/",
 
        selector: "textarea.my-editor",
        plugins: [
          "advlist autolink lists link image charmap print preview hr anchor pagebreak",
          "searchreplace wordcount visualblocks visualchars code fullscreen",
          "insertdatetime media nonbreaking save table contextmenu directionality",
          "emoticons template paste textcolor colorpicker textpattern"
        ],
        toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media",
        relative_urls: false,
        file_browser_callback : function(field_name, url, type, win) {
          var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
          var y = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;
 
          var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
          if (type == 'image') {
            cmsURL = cmsURL + "&type=Images";
          } else {
            cmsURL = cmsURL + "&type=Files";
          }
 
          tinyMCE.activeEditor.windowManager.open({
            file : cmsURL,
            title : 'Filemanager',
            width : x * 0.8,
            height : y * 0.8,
            resizable : "yes",
            close_previous : "no"
          });
        } ,
 
        //  Add Bootstrap Image Responsive class for inserted images
        image_class_list: [
            {title: 'None', value: ''},
            {title: 'Bootstrap responsive image', value: 'img-responsive'},
        ]   
 
      };
 
      tinymce.init(editor_config);
    </script>
 
@stop

Lets examine the important points from this script

First you need to load tinycme JS

1
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>

– In our editor_config JS code we have a property called “selector” where we define the class name for our textarea: my-editor, and the html:

1
<textarea class="form-control my-editor" rows="10" id="task" name="task"></textarea>

Also in editor_config we set the path_absolute property with using a Laravel url helper: {{ url(/)}} to print dynamically the url of the site.

Adding custom classes for images

Lets say you would like tinyMCE to add a dropdown to add a custom class to the image that was just selected, you can do so by adding an additional property to the editor_config options

1
2
3
4
5
6
7
8
9
10
11
12
13
  var editor_config = {
    //path_absolute : "/",
    path_absolute:"{{ url('/') }}/",
 
    // ...
 
    //  Add Bootstrap Image Responsive class for inserted images
    image_class_list: [
        {title: 'None', value: ''},
        {title: 'Bootstrap responsive image', value: 'img-responsive'},
    ]
 
  };

What this will do is add a dropdown option to add an image class to the selected image.

Why is this Laravel File Manager Package useful?

You might ask yourself why do we need to do all of these steps, we could just use any other WYSIWYG editor, here are a couple of reasons why:
1) You can use any other WYSIWYG editor but the problem is when you actually select the image, if you go into source code view you will see the image inserted as:

1
<img src="data:image/png;base64,iVBO0KGgoAAKGgoAAAANSUhiVBO0KGgoAAAANSUhEURw0KGgoAAiVBO0KGgoAAAAA0iVBO0KGgoAAAAKGgoAAAANSUhiVBO0KGgoAAAAEUANSUhEUgAAADIA..." />

the actual base64 encoding will be a lot longer than this depending on the size of the image, this means you will be storing a huge string in the database.

In our version with the help of this Laravel File Manager if you go into source code view you will see images as:

1
<img src="images/cat.jpg">

Laravel

Readmore
22 Aug
Laravel
Laravel

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Image result for ionic

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Image result for angularjs

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Image result for ngcordova

Readmore