Yii Framework – ezeelive.com https://ezeelive.com Best eCommerce Development Company India Tue, 08 Apr 2025 18:21:28 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.1 https://ezeelive.com/wp-content/uploads/2017/12/ezeelive-rich-snipper-logo-50x50.png Yii Framework – ezeelive.com https://ezeelive.com 32 32 PHP Frameworks in 2025 – 20 Best Choices for Web Development https://ezeelive.com/php-frameworks/ https://ezeelive.com/php-frameworks/#comments Thu, 03 Apr 2025 02:50:23 +0000 https://ezeelive.com/?p=2059 Wish You Happy New Year 2025…!!

PHP is more famous Website Development Technologies among Web Programmers. More than 50% Website or Web Application using or developed in PHP Frameworks.

The framework really helps in PHP development as compare core development, the framework provides every web developer base skeleton or foundation for build strong web application.

Every Framework has own Advantages and Disadvantages based on its feature and coding method.

Top 20 PHP Frameworks use in 2025

In this post we are trying to briefly the Best PHP Frameworks based on easy for installation and coding, most acceptable to the online community or help-desk, Code reference availability on internet,  inbuilt feature helps in development, stability, maintainability, and upgradeability in Web Development. Following are Top PHP Frameworks Every Developer Should Master.

In further article, we will cover following developer questions:

  • What are the best php framework available?
  • Which PHP Framework in fatest?
  • Is Codeignitor good for large application in 2025?
  • What are the most widely used PHP frameworks?
  • What are the best PHP frameworks in India?
  • Top 20 php frameworks for beginners
  • Popular PHP frameworks in 2025
  • Best PHP Frameworks and Trends in 2025

Lets go ahead and checkout all famous php frameworks:

1. Laravel

Laravel The PHP Framework for Web Artisans and one of the best PHP frameworks in 2025. Laravel Framework is the powerful feature like Restful routing, Composer Powered, Beautiful inbuilt templating (Blade template), Eloquent ORM, Artisan CLI and expressive syntax etc.

Laravel Framework

Initial Release: Laravel 1 on June 2011
Developer: Taylor Otwell
Current Version: 12.3.0 on 18 March 2025

2. Yii Framework

Yii Framework is fast, secure, stable, high-performance PHP framework for developing Web 2.0 applications. Yii2 provided the basis and advanced application installation based on requirement.

Yii Framework comes with Rich Feature Layered caching scheme, Model-View-Controller (MVC) design pattern, Database Access Objects (DAO)/ Active Record, I18N/L10N, Role-based access and authentication, Gii (automatic code generation) code generator module, AJAX-enabled widgets, Detailed documentation, Eager & Lazy Loading, Easily integrated third-party code and system etc. Yii is ideal framework for developing social media, enterprises web application, SAAS, PAAS etc.

Yii Framework

Initial Release: Yii 1 on 03 December 2008
Developer: Qiang Xue
Latest Version: 2.0.52 on 12 February 2025

3. Zend Framework (Laminas)

No doubt about Zend Framework in this list and top 3 possible because it is flexible architecture and widely acceptable for enterprises web application development.

Laminas Enterprise PHP Framework

Zend Framework

It’s worth noting that in 2018, the Zend Framework project underwent a major change. The project transitioned into the Laminas Project, which is now known as Laminas. Laminas is an evolution of Zend Framework and continues to offer a set of components for building PHP applications.

Initial Release: ZF Library on 03 March 2006
Developer: Zend, Linux Foundation

4. CodeIgniter

CodeIgniter is one of simple, powerful PHP framework. According to PHP creator Rasmus Lerdorf “CodeIgniter is faster, lighter and the least like a framework.”

It comes with notable features such as Lightweight and Fast, MVC Architecture, Built-in Security, Easy Configuration, Libraries and Helpers with Easy Learning Curve.

10 reason why codeigniter is better than other php frameworks

Initial Release: CI 1.0 on 28 February 2006
Developer: British Columbia Institute of Technology, Codeigniter Foundation
Latest Version: 4.6.0 on 19 January 2024

5. CakePHP

Cakephp is one of oldest PHP Framework build by Polish programmer Michal Tatarynowicz inspiring by Ruby on Rails in April 2005. Scratch, Hot Scripts, and Croogo CMS made in CakePHP.

CakePHP Framework

Initial Release: CakePHP 1.0 on April 2005
Developer: Larry Masters
Latest Version: 5.1.5 on 16 January 2025

It comes with notable features such as Convention over Configuration, Built-in ORM, Scaffolding and Extensive Caching.

6. Symfony

Symfony Framework is the focus to set of reusable PHP Components for Enterprises Web Projects. Drupal, phpBB, Laravel, OROCRM and PIWIK etc. using Symfony.

Symfony PHP Framework

Initial Release: 22 October 2005
Developer: SensioLabs SAS
Latest Version: 7.2.0 on 29 November 2024

Symfony offers notable features such as Component-Based Architecture, Twig Templating Engine, Robust Security, Powerful Routing System and Testing and Debugging Tools.

7. Phalcon

Phalcon is open source, high-performance web application framework for PHP. It implemented C extension for optimum performance to the goal of handle more requests per second than other PHP Frameworks. Phalcon has all the feature which might make it No. 1 PHP Framework as Compare Laravel.

Phalcon offers features High Performance, Low Overhead with C extension, MVC Architecture, Extensive ORM and Rich Ecosystem.

Phalcon PHP Framework

Initial Release: 14 November 2012
Developer: Andres Gutierrez
Latest Version: 5.8.0 on 09 July 2024

8. FuelPHP

FuelPHP is open source HMVC PHP Framework.

Fuel PHP Framework

Initial Release: 2.0 alpha on 01 January 2014
Developer: Andres Gutierrez
Latest Version: 1.0.9 on 28 December 2021

9. Kohana

Kohana is easy, lightweight and easy to use HMVC PHP Framework.

Ezeelive Technologies - kohana php framework

10. Prado

Prado name acronym from “PHP Rapid Application Development Object-oriented”. It is started by Qiang Xue inspired by Apache Tapestry. Based on Prado experience Qiang Xue developed Yii Framework. Prado first initial release was in June 2004.

Prado PHP Framework India

11. Slim

Slim is lightweight micro PHP framework help for quick write simple application and APIs.

Slim PHP Framework

12. Flight

Another fast, extensive micro PHP framework, simple and easy to use PHP Framework for build Restful PHP Web Applications. Running Flight requires minimum PHP 5.3 or greater version.

Flight PHP Framework

13. Webasyst

Webasyst is help for teamwork, collaborate, building website and stores.

Webasyst PHP Framework

14. PHPixie

New lightweight PHP Framework and a fork of Kohana Framework.

Phpixie PHP Framework

15. Aura

Aura PHP Framework provides lightweight, well-tested, decoupled libraries and standards-compliant.

AURA PHP Framework

16. Medoo

Medoo is one of the lightest database frameworks.

Medoo PHP Framework

17. Yaf

Yet Another Framework is first MVC Framework which written in C and builds as PHP Extension.

YAF PHP Framework

18. Silex

A Concise, Extensible, Testable Micro PHP Framework based on the Symfony2 Components.

Silex PHP Framework

19. Agavi

Agavi is simple, scalable, powerful PHP MVC Framework.

Agavi PHP Framework

20. Nette

Nette Framework is developed by David Grudl, an open source PHP Framework.

NETTE PHP Framework

There is another PHP Framework eg. Guzzle  PHP, LIMONADE, Ubiquity, Pop PHP etc.

]]>
https://ezeelive.com/php-frameworks/feed/ 9
Yii Framework and Its Features https://ezeelive.com/yii-framework-and-its-features/ https://ezeelive.com/yii-framework-and-its-features/#comments Thu, 15 Feb 2024 12:00:14 +0000 https://ezeelive.com/?p=903 Yii Framework is a free, open-source Web application development framework written in PHP5 that promotes clean, DRY design and encourages rapid development.

It works to streamline your application development and helps to ensure an extremely efficient, extensible, and maintainable end product. YII is a perfect choice for any sized project. However, it has been built with sophisticated, enterprise applications in mind.

Features of Yii Framework:

Whether you are one developer building a fairly simple Web site, or a team of distributed developers building an extremely complex Web application, using Yii is like augmenting your development team with additional experienced, professional, and efficient resources.

1.  Model-View-Controller (MVC) design pattern

Yii implements the model-view-controller (MVC) design pattern, which is widely adopted in Web programming. MVC aims to separate business logic from user interface considerations, so that developers can more easily change each part without affecting the other.

In MVC, the model represents the information (the data) and the business rules; the view contains elements of the user interface such as text, form inputs; and the controller manages the communication between the model and the view.

2. Database Access Objects (DAO), Query Builder, Active Record, DB Migration

Built on top of the PHP Data Objects (PDO) extension, Yii Data Access Objects (DAO) enables accessing to different database management systems (DBMS) in a single uniform interface.

Applications developed using Yii DAO can be easily switched to use a different DBMS without the need to modify the data accessing code. Yii Query Builder offers an object-oriented method for building SQL queries, which helps reduce risk of SQL injection attacks.

3. Form input and validation

Collecting user data via HTML forms is one of the major tasks in Web application development. Besides designing forms, developers need to populate the form with existing data or default values, validate user input, display appropriate error messages for invalid input, and save the input to persistent storage. Yii greatly simplifies this workflow with its MVC architecture.

4. AJAX-enabled widgets

Extending Yii is a common activity during development. For example, when you write a new controller, you extend Yii by inheriting its CController class; when you write a new widget, you are extending CWidget or an existing widget class. If the extended code is designed to be reused by third-party developers, we call it an extension.

5. Authentication and authorization

The central piece in the Yii auth is a pre-declared user application component which is an object implementing the [IWebUser] interface.

The user component represents the persistent identity information for the current user. We can access it at any place using Yii::app()->user. Using the user component, we can check if a user is logged in or not via CWebUser::isGuest; we can log-in and log-out a user; we can check if the user can perform specific operations by calling CWebUser::checkAccess; and we can also obtain the unique identifier and other persistent identity information about the user.

6. Skinning and Theming

In Yii, each theme is represented as a directory consisting of view files, layout files, and relevant resource files such as images, CSS files, JavaScript files, etc.

The name of a theme is its directory name. All themes reside under the same directoryWebRoot/themes. At any time, only one theme can be active.

7. Web services

Yii Framework provides CWebService and CWebServiceAction to simplify the work of implementing Web service in a Web application. The APIs are grouped into classes, called service providers.

Yii will generate for each class a WSDL specification which describes what APIs are available and how they should be invoked by the client. When an API is invoked by a client, Yii will instantiate the corresponding service provider and call the requested API to fulfill the request.

8. Layered caching scheme

  • Yii provides various cache components that can store cached data in different media.
  • CMemCache: uses PHP memcache extension.
  • CApcCache uses PHP APC extension.
  • CXCache uses PHP XCache extension.
  • CEAcceleratorCache: uses PHP EAccelerator extension.
  • CDbCache: uses a database table to store cached data. By default, it will create and use an SQLite3 database under the runtime directory. You can explicitly specify a database for it to use by setting its connection id property.
  • CZendDataCache uses Zend Data Cache as the underlying caching medium.
  • CFileCache uses files to store cached data. This is particularly suitable to cache large chunk of data (such as pages).
  • CDummyCache presents dummy cache that does no caching at all. The purpose of this component is to simplify the code that needs to check the availability of cache. For example, during development or if the server doesn’t have actual cache support, we can use this cache component. When an actual cache support is enabled, we can switch to use the corresponding cache component. In both cases, we can use the same code Yii::app()->cache->get($key) to attempt retrieving a piece of data without worrying that Yii::app()->cache might be null.

9. Error Handling and Logging

Yii provides a complete error handling framework based on the PHP 5 exception mechanism. When the application is created to handle an incoming user request, it registers its handleError method to handle PHP warnings and notices; and it registers its handleException method to handle uncaught PHP exceptions.

Consequently, if a PHP warning/notice or an uncaught exception occurs during the application execution, one of the error handlers will take over the control and start the necessary error handling procedure.

10. Security

A. Cross-site Scripting Prevention:

Yii incorporates the work of HTMLPurifier and provides developers with a useful component called CHtmlPurifierthat encapsulates HTMLPurifier.

B. Cross-site Request Forgery Prevention:

To prevent CSRF attacks, it is important to abide by the rule that GET requests should only be allowed to retrieve data rather than modify any data on the server.

And for POST requests, they should include some random value which can be recognized by the server to ensure the form is submitted from and the result is sent back to the same origin.

Yii implements a CSRF prevention scheme to help defeat POST-based attacks. It is based on storing a random value in a cookie and comparing this value with the value submitted via the POST request.

C. Cookie Attack Prevention:

Yii implements a cookie validation scheme that prevents cookies from being modified. In particular, it does HMAC check for the cookie values if cookie validation is enabled.

11. Automatic code generation:

Yii is equipped with a Web-based code generation tool called Gii. It supersedes the previous yiic shell generation tool which runs on command line. In this section, we will describe how to use Gii and how to extend Gii to increase our development productivity.

12. Friendly with third-party code:

Yii is carefully designed so that third-party libraries can be easily integrated to further extend Yii’s functionalities. When using third-party libraries in a project, developers often encounter issues about class naming and file inclusion.

Because all Yii classes are prefixed with letter C, it is the less likely class naming issue would occur; and because Yii relies on SPL autoload to perform class file inclusion, it can play nicely with other libraries if they use the same autoloading feature or PHP include the path to include class files.

]]>
https://ezeelive.com/yii-framework-and-its-features/feed/ 4
What makes Doctrine ORM the best in 2025? https://ezeelive.com/doctrine-orm/ https://ezeelive.com/doctrine-orm/#respond Thu, 18 Dec 2014 12:11:06 +0000 https://ezeelive.com/?p=2053 What is ORM? ORM stands for the object-relational mapping. ORM is a programming technique used to convert the data between incompatible type system in an object-oriented programming language.

It created the “virtual object database” that can be used within the programming languages. There are many ORM’s available in the market in each technology in which some famous ORM are ActiveJPA, ActiveRecord (AR in Yii Framework) Ebean, Database objects, CakePHP, Propel and the best one Doctrine. But why Doctrine ORM is so famous and best, what is the reason behind this we will look on this below but we will learn first what is Doctrine? Doctrine is a set of PHP libraries which primarily focus on providing persistence services and related functionality.

Doctrine 2.x (Data mapping using Entity Manager):

$student = new Student();
$student->fname = "rajeev";
$student->lname = "sharma";
$entityManager->persist($student);
$entityManager->flush();
echo "The student with id $student->id has been saved.";

Doctrine 1.x (Active Record pattern):

$student = new Student();
$student->name = "rajeev";
$student->password = "Sharma";
$student->save();
echo "The student with id $student->id has been saved.";

1. Logical domain keeps separate from the presentational logic:

The main is the software industry is how you co-relate your logical and how that logical part full-fill the presentation part for the user.

In many ORM if you will use then you will find that there are strict rule of that, that you have to use particular way only for the particular presentation but in Doctrine both the things are kept separated you can make your full logical first and then you decide what the view or in presentation you want or vice-versa.

2. Easily enforcement of Business rules:

Each application has some business logic that on which terms and conditions application should be work according to the requirements.

So, same there is also with the Doctrine the business rules consist of rules and processes around how the application should work. Knowing when and where to put the business rules little bit a tricky.

This business logic should be kept in the controller. Normally you will see the logic like this in the controller:

public function ezeelive()
{
$ezee = User::find(Input::get('userid');
$ezee2 = ezee2::find(Input::get('ezee2id');

if($ezee2->users->contains($ezee)
{
$ezee2->posts()->save(Post::create(Input::all()));
}
return $ezee2;
}

You can enforce the business logic like this

public function addPost(Post $abc)
{
if($this->isMemberOf($abc->user))
{
$this->xyz[] = $abc;
}
}

This is a easiest way to use the business logic in ORM which the only Doctrine have none other.

3. Doctrine behavior support:

All behaviors supported in Doctrine ORM are well supported by the ORM designers. You have to just write the definition once in a code and everywhere you can refer to the same again and again.

You can also configure the behavior of these function by going into the config file and do changes as per your convenience.

By using ORM design you can create the behaviors in a minute. You have to select the options according to the value and that will be assigned to your definition behavior it’s so easy in the Doctrine that easily defined behaviors get assigned to the project.

4. Inheritance:

Inheritance is again the great feature implemented in this ORM. With ORM design you will not get any problem in implementing the inheritance. ORM designers wizard gives easy and great way to do so.

5. MVC framework:

You can use Doctrine ORM with any MVC framework for the project use. In ORM designers there is an explicit support for the 2 most used MVC frameworks that are Symfony and Zend framework.

Use of any other MVC framework is also very east in the Doctrine you have to just choose the option “without MVC” at the start of your project.

The feature of Doctrine ORM 2.5 :

  1. Doctrine 2.5 require minimum PHP 5.4 and dropping support for PHP 5.3
  2. PostLoad events now triggered after associations are loaded
  3. Embeddable Objects supports creating multiple PHP objects from one database table.
  4. Second-Level-Cache: objects cache in Memcache, Redis, Riak, MongoDB etc.
  5. Support for ManyToMany associations
  6. Add new contains() expression criteria : For like SQL condition
  7. Allow configuring Index flags

In the Last Word:

After looking at these major advancements and features in the Doctrine ORM we can say that Doctrine is the best ORM system available till now with the MVC framework that can be implemented with any technology.

By taking these reasons in the mind we will suggest you use Doctrine ORM only for the exchange of data between the incompatible system and language.

]]>
https://ezeelive.com/doctrine-orm/feed/ 0
Zaakpay Extension in Yii Framework https://ezeelive.com/zaakpay-extension-in-yii-framework/ https://ezeelive.com/zaakpay-extension-in-yii-framework/#comments Tue, 11 Mar 2014 16:20:25 +0000 https://ezeelive.com/?p=1093 In the Yii framework, extensions (also known as “Yii packages” or “Yii extensions”) are third-party libraries or modules that you can integrate into your Yii application to add additional functionality. These extensions can be anything from widgets and components to entire modules that provide specific features or integrations.

Zaakpay is an Indian payment gateway that provides services for online payments, so an extension related to it could potentially facilitate easier integration of Zaakpay’s services into e-commerce websites or applications.

1. Click here to Download Zaakpay extension, extract and Copy and paste zaakpay folder with all the files in Protected -> Extension folder
2. Register on www.zaakpay.com and verify your account
3. Go to in Dashboard -> Integration and Click on URLs & Keys Tab

zaakpay setup basic integration key and url - ezeelive technologies

4. Create Controller and View folder, here controller name is Zaakpay for example.
5. Create below mention action and define access permission (In my case it is “allow all users”).

public function actionPosttozaakpay()
{
echo $this->renderPartial('postzaakpay');
Yii::app()->end();
}
public function actionResponse()
{
echo $this->renderPartial('response');
Yii::app()->end();
}
public function actionReturn_url()
{
//return response url defined in zaakpay account
}

public function actionCheckout()
{
//checkout page with zaakpay form
$this->render('checkout');
Yii::app()->end();
}

6. Create checkout.php in zaakpay view folder, add below code in the page HTML body section.

function zaakpay_frm()
var frm = '';
frm += '<form id="zkpayform" style="display:none;" method="post">';
frm += '<input type="text" id="zkpaymerchantIdentifier" name="merchantIdentifier" value="merchant indentifier key" />';
frm += '<input type="text" id="zkpayorderId" name="orderId" />';
frm += '<input type="text" id="zkpaybuyerEmail" name="buyerEmail" value="" /> ';
frm += '<input type="text" id="zkpaybuyerFirstName" name="buyerFirstName" value="" /> ';
frm += '<input type="text" id="zkpaybuyerLastName" name="buyerLastName" value="" /> ';
frm += '<input type="text" id="zkpaybuyerAddress" name="buyerAddress" value="" /> ';
frm += '<input type="text" id="zkpaybuyerCity" name="buyerCity" value="" />';
frm += '<input type="text" id="zkpaybuyerState" name="buyerState" value="" />';
frm += '<input type="text" id="zkpaybuyerCountry" name="buyerCountry" value="" /> ';
frm += '<input type="text" id="zkpayPincode" name="buyerPincode" value="" /> ';
frm += '<input type="text" id="zkpaybuyerPhoneNumber" name="buyerPhoneNumber" value="" />';
frm += '<input type="text" id="zkpaytxnType" name="txnType" value="1" />';
frm += '<input type="text" id="zkpayzpPayOption" name="zpPayOption" value="1" />';
frm += '<input type="text" id="zkpaymode" name="mode" value="0" /> ';
frm += '<input type="text" id="zkpaycurrency" name="currency" value="INR" />';
frm += '<input type="text" id="zkpayamount" name="amount" value="" /> ';
frm += '<input type="text" id="zkpaymerchantIpAddress" name="merchantIpAddress" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" />';
frm += '<input type="text" id="zkpaypurpose" name="purpose" value="1" />';
frm += '<input type="text" id="zkpayproductDescription" name="productDescription" value="" />';
frm += '<input type="text" id="zkpayproduct1Description" name="product1Description" value="" />';
frm += '<input type="text" id="zkpayproduct2Description" name="product2Description" value="" />';
frm += '<input type="text" id="zkpayreturnUrl" name="returnUrl" value="" />';
frm += '<input type="text" id="zkpaytxnDate" name="txnDate" value="<?php echo date('Y-m-d'); ?>" />';
frm += '</form>';
$('body').append(frm);

$('#zkpayreturnUrl').val('<?php echo Yii::app()->createAbsoluteUrl('/zaakpay/return_url'); ?>?additional_parameters=' + additional_values);
$('#zkpayform')[0].action = '<?php echo Yii::app()->createUrl('/zaakpay/posttozaakpay'); ?>';
$('#zkpayform')[0].submit();
}

Add all require input value and call zaakpay_frm() for document.ready (using jquery) or body onLoad.

If you face any problem in, setup or execution, Please fill free to contact us on +91 9822117730

]]>
https://ezeelive.com/zaakpay-extension-in-yii-framework/feed/ 5
Yii PHP Framework the first choice for development https://ezeelive.com/yii-php-framework-the-first-choice-for-development/ https://ezeelive.com/yii-php-framework-the-first-choice-for-development/#comments Fri, 28 Feb 2014 11:30:00 +0000 https://ezeelive.com/?p=885 Ezeelive Technologies is leading Yii Framework Development Company in India. We have the expert team in core PHP and frameworks e.g. Zend, CakePHP, CodeIgniter (CI), Symphony, Kohana and from last 3 year, we are using Yii Framework.

Now We are preferring using Yii framework in Major development work. Check out below reason why Yii Framework is our First Choice in development :

  1. The first and major advantages is Yii has Web GUI based GII module for generating module, model, controller and views
  2. In GII You can select which view you want to create or not by selecting in one screen only.
  3. Creating Model in Gii Provide AutoPopulate Table Names to selection
  4. Yii has in-build ORM module (Yii Active Record) to making query faster, validate and secure (protection from SQL injection)
  5. Yii is building for development faster and provide delivery to the client on time. The Gii Module generate the require structured CRUD with all the basic input validation, search and listing, view and update functionality. Web Developer/Coder has to change the code according to require.
  6. Yii comes with all major SQL and no-SQL database support.
  7. Yii is faster than other framework and can integrate with CMS e.g. WordPress, Drupal etc.
  8. Yii has growing forum community and extensions list

Above list is suggested by our development team who are working on live projects in Using Yii Framework rather than another php framework.

Yes, we agree every framework has advantages and disadvantages in the development and we select the framework as per project requirement but currently Yii Framework is filling all our development requirement and BECOME No. 1 for Our development work.

Contact Ezeelive Technologies at +91 9822117730 for mail us to hire Yii developer in India, we provided Yii framework experts in affordable price for hourly bases or project basis work depend on requirement.

]]>
https://ezeelive.com/yii-php-framework-the-first-choice-for-development/feed/ 22
Create custom params file in yii framework https://ezeelive.com/create-custom-params-file-in-yii-framework/ https://ezeelive.com/create-custom-params-file-in-yii-framework/#respond Mon, 17 Feb 2014 16:45:57 +0000 https://ezeelive.com/?p=1 Create custom params in yii framework

Yii Framework comes with powerful inbuilt features special create custom params in yii framework eg.

  1. Model-View-Controller (MVC) design pattern
  2. Database Access Objects (DAO)
  3. Custom Query Builder, Active Record (AR) and DB Migration
  4. Form input and validation
  5. AJAX-enabled widgets
  6. Authentication and authorization
  7. Layout Skinning and theming
  8. Web services
  9. Internationalization (I18N) and localization (L10N)
  10. Layered caching scheme
  11. Error handling and logging
  12. Security
  13. Unit and functionality testing
  14. Automatic code generation (Gii Module)
  15. Friendly with third-party code
  16. Detailed documentation and Active Community
  17. Extension library
  18. Widget-Based Development
  19. Event-Driven Programming
  20. Scaffolding
  21. Multi-Tier Caching
  22. Dependency Injection Container
  23. Console Applications
  24. Lazy Loading and Eager Loading
  25. Web Services and SOAP Support
  26. Debugging Tools: Yii’s debug toolbar provides real-time insights into application performance, database queries, and memory usage during development.
  27. Queue Support: Yii includes built-in support for queuing systems, enabling background job processing using drivers like RabbitMQ, Redis, and Beanstalk.
  28. Cloud Integration: Yii integrates easily with cloud services like AWS, Azure, and Google Cloud for storage, computing, and APIs.
  29. Asset Management: Yii manages CSS, JavaScript, and other assets efficiently, supporting features like bundling and minimizing to improve performance.
  30. Dynamic Querying: Yii allows dynamic query construction with its query builder, supporting complex joins, conditions, and relations in a readable format.

Most of the Yii beginner use main.php file to create custom params in yii framework because that’s pattern comes in installed Yii framework. This is fine if you have less parameter but if you are building large web portal or application then it’s very hard to manage everything in mail.php because of its main config file. So the best way is creating separate params.php in the same directory and includes it in your main.php file. The check is the example of params.php and main.php files for create custom params in yii framework.

config/main.php :

'params'=>require(dirname(__FILE__).'/params.php'),

config/params.php :


<?php
return array(
 'defaultPageSize'=>10,
 'websiteName'=>'ezeelive.com',
 'copyrightInfo'=>'Copyright &copy; '.date("Y").' Ezeelive Technologies. All Rights Reserved.',
 ...
 ...
);
?>

In Yii2 Framework:

1. config/main.php (advance backend application):



<?php // You can add your custom params file here $params = array_merge( require(__DIR__ . '/../../common/config/params.php'), require(__DIR__ . '/../../common/config/params-local.php'), require(__DIR__ . '/params.php'), require(__DIR__ . '/params-local.php') ); return [ 'id' => 'backend-app',
        'name' => 'Backend App',
        'basePath' => dirname(__DIR__),
        'bootstrap' => ['log'],
        'controllerNamespace' => 'backend\controllers',
        'modules' => [],
        'components' => [
            'log' => [
                'traceLevel' => YII_DEBUG ? 3 : 0,
                'targets' => [
                    [
                        'class' => 'yii\log\FileTarget',
                        'levels' => ['error', 'warning'],
                    ],
                ],
            ],
            'errorHandler' => [
                'errorAction' => 'site/error',
            ],
        ],
        'params' => $params,
    ];

In this example, we are using params.php file.

2. In params.php:


<?php return [ 'adminEmail' => 'info@ezeelive.com',
 ];

3. Access param variable:


$params['mandrill_api_key'] 
  OR 
  \Yii::$app->params['mandrill_api_key']
]]>
https://ezeelive.com/create-custom-params-file-in-yii-framework/feed/ 0
How to Use Two Databases in Yii PHP Framework https://ezeelive.com/how-to-use-two-databases-in-yii-php-framework/ https://ezeelive.com/how-to-use-two-databases-in-yii-php-framework/#comments Fri, 17 Jan 2014 09:50:47 +0000 https://ezeelive.com/?p=849 In Yii framework, using multiple databases is relatively straightforward. You can configure multiple database connections in the configuration file and then access these connections as needed throughout your application.

Recently in one of Ireland based project client has the requirement to use existing Microsoft SQL Server database and implement new feature and store data into MySQL database with Yii Framework along with multiple database connections.

Ezeelive Technologies developer has code changes in Yii framework and setup option to Use Two Databases in Yii PHP Framework.

First, we have installed and implement Microsoft SQL server driver in wamp server to make in localhost environment. Now we have to connect both the Database in Yii Framework. Following is steps to implement in Yii Framework :

1. In protected/config folder open main.php and add below code in component for MySQL and SQL server connection

'db'=>array(  // default mysql connection
 'connectionString' => 'mysql:host=localhost;port=3306;dbname=db_name',
 'emulatePrepare' => true,
 'username' => 'db_username',
 'password' => 'db_password',
 'charset' => 'utf8',
 'tablePrefix' =>'tbl_',  // if have prefix in database tables
),
'msdb'=>array( // microsoft sql server connection
 'class' => 'CDbConnection',
 'connectionString' => 'sqlsrv:Server=host_name or ip_address;Database=db_name',
 'username' => 'db_username',
 'password' => 'db_password',
 'charset' => 'GB2312',
),

2. Now SQL server connection is available in your entire application and access by CDbCommand

$company_name=Yii::app()->msdb->createCommand("SELECT TOP 1 CompanyName from Company_Details WHERE CompanyID="ezeelive")->queryRow();
if(isset($company_name) && !empty($company_name["CompanyName"])):
 echo $company_name["CompanyName"]; // it will print company name Ezeelive Technologies
else:
 echo '';
endif;

In above example we have use msdb define database connection in component

3. Sometimes we require to get the data from one table and insert into another database table, In this case, you can use createCommand to write custom loop or you can Switch database connection runtime in model class

class Company extends CActiveRecord
{
 public function init()
 {
 $this->attachEventHandler('OnBeforeSave',   array($this,'switchToWriter'));
 $this->attachEventHandler('OnAfterSave',   array($this,'switchToReader'));
 }
 public function switchToWriter()
 {
 self::$db=Yii::app()->db;
 return true;
 }
 public function switchToReader()
 {
 self::$db=Yii::app()->msdb;
 return true;
 }
 //...
}

In above example database connection will swapping means the connection will automatically change in fetching and inserting time. “switchToReader” function for fetching the data from SQL Server database and “switchToWriter” for insert/save data into MySQL database.

By following these steps, you can easily configure and use multiple databases within your Yii application. Adjust the configurations and access methods according to your specific requirements.

Please fill free to contact us or leave a comment for any type of development, integration, coding problem and help in use two databases in yii php framework. Keep Coding…!!

]]>
https://ezeelive.com/how-to-use-two-databases-in-yii-php-framework/feed/ 1
Custom export into excel in Yii Framework https://ezeelive.com/custom-export-excel-yii-framework/ https://ezeelive.com/custom-export-excel-yii-framework/#comments Thu, 09 Jan 2014 10:00:21 +0000 https://ezeelive.com/?p=856 Custom export into excel in Yii Framework

Hello Friend, In one our project developed in Yii. I was struggling to export the cgridview data into excel. I searched many plugins and read the tutorial. But not get proper solution especially with relational data from one or many models (MySQL database tables). I try excelview, toexcel etc. Yii plugin but it was really slow especially on large data fetch and also not getting proper excel format. After spending some time, I planned to write my own custom export in excel code in Yii framework.

Creating a custom plugin in Yii framework involves creating reusable components that can be easily integrated into your application. Plugins in Yii are typically implemented as Yii extensions.

Here’s a step-by-step guide on how to develop a custom plugin in Yii:

1. In model search function define session global variable and store active search data (set pagination false so you will get all the record without paging)

public function search()
{
 $criteria=new CDbCriteria;
 $criteria->compare('vendor_debit_id',$this->vendor_debit_id);
 $criteria->compare('hotel_id',$this->hotel_id);
 $criteria->compare('supplier_name',$this->supplier_name,true);
 $criteria->compare('debit_amount',$this->debit_amount);
 $criteria->compare('bal_before_debit',$this->bal_before_debit);
 $criteria->compare('bal_after_debit',$this->bal_after_debit);
 $criteria->compare('debit_sheet_no',$this->debit_sheet_no,true);
 $criteria->compare('created_on',$this->created_on,true);
 $criteria->compare('admin_id',$this->admin_id);
 $data = new CActiveDataProvider($this, array(
 'criteria'=>$criteria,
 ));
 $_SESSION['vendor_debit_export_excel'] = new CActiveDataProvider($this, array('criteria' => $criteria, 'pagination' => false));;
 return $data;
}

2. Open controller class and define the function for export in excel. Remember for unset session variable into the end for you controller function before the end the function execution.

public function actionExport_excel()
{
 if(isset($_SESSION['vendor_debit_export_excel'])):
 header("Content-type: application/vnd.ms-excel");
 header("Content-Disposition: attachment;Filename=vendor-debit-report.xls");
 $dataProvider = $_SESSION['vendor_debit_export_excel'];
 $data = array();
 foreach($dataProvider->getData() as $record) {
 $data[] = array(
 'vendor_debit_id'=>$record->vendor_debit_id,
 'hotel_id'=>$record->hotel->name,
 'supplier_name'=>$record->supplier_name,
 'debit_amount'=>$record->debit_amount,
 'bal_before_debit'=>$record->bal_before_debit,
 'bal_after_debit'=>$record->bal_after_debit,
 'debit_sheet_no'=>$record->debit_sheet_no,
 'admin_id'=>Users::model()->usernameWithName($record->admin_id),
 'created_on'=>Yii::app()->dateFormatter->format("d/MM/y, h:m a", strtotime($record->created_on))
 );
 }
 echo $this->renderPartial('//hotelvendordebit/vendor_debit_excel',array('excel_data'=>$data));
 unset($_SESSION['vendor_debit_export_excel']);    
 Yii::app()->end();
 else:
 throw new CHttpException(500,'An error occurred in fetching data. please try later'); // Error message as per your convenient
 endif;
}

3. Now the final create and rederpartial view file into your relative view folder and pass the data(in the array).

<html>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<body>
 <table border="1" cellpadding="5" style="font-size:10px;font-family:tahoma,arial;" cellspacing="0" bordercolor="#666666">
 <tr>
 <td align="center"><strong>Debit ID</strong></td>
 <td align="center"><strong>Hotel</strong></td>
 <td align="center"><strong>Supplier Name</strong></td>
 <td align="center"><strong>Debit Amount</strong></td>
 <td align="center"><strong>Balance Before Debit</strong></td>
 <td align="center"><strong>Balance After Debit</strong></td>
 <td align="center"><strong>Debit Sheet No.</strong></td>
 <td align="center"><strong>Create/ Update User</strong></td>
 <td align="center"><strong>Created On</strong></td>
 </tr>
 <?php
 if(isset($excel_data)):
 for($i=0;$i<count($excel_data);$i++):
 print_r($data);
 ?>
 <tr>
 <td><?php echo $excel_data[$i]["vendor_debit_id"];?></td>
 <td><?php echo $excel_data[$i]["hotel_id"];?></td>
 <td><?php echo $excel_data[$i]["supplier_name"];?></td>
 <td><?php echo $excel_data[$i]["debit_amount"];?></td>
 <td><?php echo $excel_data[$i]["bal_before_debit"];?></td>
 <td><?php echo $excel_data[$i]["bal_after_debit"];?></td>
 <td><?php echo $excel_data[$i]["debit_sheet_no"];?></td>
 <td><?php echo $excel_data[$i]["admin_id"];?></td>
 <td><?php echo $excel_data[$i]["created_on"];?></td>
 </tr>
 <?php
 endfor;
 endif;
 ?>
 </table>
</body>
</html>

If you find any difficulty to the problem in integration. Please put the comment or contact us. We will feel happy to help you any problem related with Yii framework.

]]>
https://ezeelive.com/custom-export-excel-yii-framework/feed/ 4
Yii PHP Framework Performance – How Fast Is It Really? Speed Matters https://ezeelive.com/yii-php-framework-performance/ https://ezeelive.com/yii-php-framework-performance/#respond Tue, 28 Jun 2011 07:37:38 +0000 https://ezeelive.com/?p=3972 PHP Yii 1.1 Framework is a high-performance framework. The graph below shows how efficient Yii is when compared with other popular PHP frameworks.

In the graph, RPS stands for “request per second” which describes how many requests an application written in a framework can process per second.

The higher the number, the more efficient a framework is. As we can see that Yii outperforms all other frameworks in this comparison. The performance advantage of Yii is especially significant when the widely used APC extension is enabled.

Performance alone is not the whole story (otherwise we should all use plain HTML or PHP). With such superior performance, Yii still provides a very rich feature set which can greatly improve your development efficiency.

Why Yii is so Fast :

PHP Yii Framework is so much faster because it is using the lazy loading technique extensively. For example, it does not include a class file until the class is used for the first time; and it does not create an object until the object is accessed for the first time.

Other frameworks suffer from the performance hit because they would enable a functionality (e.g. DB connection, user session) no matter it is used or not during a request.

]]>
https://ezeelive.com/yii-php-framework-performance/feed/ 0
Yii Framework 1.1 (PHP) Explained : A Practical Approach Yii 1 Framework https://ezeelive.com/yii-1-framework/ https://ezeelive.com/yii-1-framework/#respond Sun, 05 Jun 2011 16:40:23 +0000 http://sw-themes.com/porto_dummy/?p=1528

Hey friends..I’m using Yii 1.1 Framework for quite a few days now, and things which I found impressive about Yii framework are:

  1. Easy 2-step Installation.
  2. Clean and thorough Tutorials and Documentation with large Community base. In fact, if you’re willing to start using Yii, follow this tutorial by Larry Ulman – The best I found so far, on the Internet, from a beginner’s perspective.
  3. Uses MVC (Model-View-Controller) Framework structure, which is very popular these days among Web applications. I’ll be explaining MVC in a separate post later on.
  4. It generates Model, View, and Controller files for your application project by just accessing the database. So, after the installation, the next step you need to do is to create a Database schema for your application and use the Gii tool provided with Yii Framework files, to generate those files from the Database schema –  The part I liked most about Yii. Thus, most of the basic frame of your application is generated by Yii within minutes, without requiring your assistance in writing a single bit of PHP code. Other things it generates by default, are a Captcha enabled Contact form, and a Simple Login system, which can be customized as per your requirements.
  5. Yii also provides built-in jQuery support and supports AJAX for many operations such as Form validation, File Upload, dynamically updating page portion, etc.
  6. Supports extensions to enhance the functionality of your application. There is increasing number of extensions available on the Yii Framework’s website.
  7.  Yii framework has tons of active code online on Google and available plugins require and web development
  8.  Yii Framework can easily integrate with CMS system like Wordpress.
  9.  Yii Framework developer India (ezeelive technologies) having more than 6 years working exp. in Yii framework development and provided custom modules and plugins based on requirement.
]]>
https://ezeelive.com/yii-1-framework/feed/ 0