Skip to main content

Create custom params file in yii framework



Yii framework is come with powerful inbuild features 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 
17. Extension library etc.

Most of yii beginner write parameter in main.php because thats 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 every thing in mail.php because its main config file. So the best way is create seperate params.php in the same directory and include it in you main.php file. Check is below example of params.php and main.php files.
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.',
 ...
 ...
);
?>

Comments

  1. As a web development and design service provider Webzin Infotech provides optimum solutions to customer by helping them to achive there goals and make available there services and products in the online market.

    ReplyDelete
  2. Every web design companies and development firms should give the proper responsive to their clients have capability to fulfill the requirement of customers.Then only they would get a chance to improve their business.
    Web Design Company | Website Design Companies

    ReplyDelete
  3. Thanks for sharing such a wonderful post.We also provides the best Web Design & Development services in India.

    ReplyDelete

Post a Comment

Popular posts from this blog

Overcoming Challenges in Adopting Generative AI in India

Adopting Generative AI in India presents several challenges, but it also offers significant opportunities for growth across various sectors. Here are some key obstacles and strategies to overcome them: 1. Infrastructure and Resource Limitations Challenge : India still faces issues with the availability of high-performance computing resources needed for generative AI models. This includes access to powerful GPUs and cloud services, which can be expensive. Solution : Partnerships with global tech firms can help bring advanced infrastructure to India. Government initiatives like the National AI Strategy and collaboration with research institutions can also boost local capabilities. 2. Data Privacy and Security Concerns Challenge : Data security is a significant concern, especially with the collection and usage of sensitive information. India's data protection laws, such as the Personal Data Protection Bill, are still evolving. Solution : Clear regulatory frameworks around data usage ...

Check and Use GZIP Compression through PHP

gzip compression is using for increase website speed and save server bandwidth. Read the below points to add gzip compression in your website: 1. Ask Hosting server provider to enable  gzip compresssion . 2. Compress all the css and js file using  7-zip  e.g. if your css file name is style.css it will save as style.css.gz. 3. Upload all the file on live server and set Content Encode GZIP to .gz files 4. Define  gzip global variable  in your common php file (remember the common file will include in all the php file into your website) $gzip_string=""; if (substr_count($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip")) { $gzip_string=".gz"; }else{ $gzip_string=""; } 5. Put defined variable in all your script and style including in your php pages e.g. <link rel="stylesheet" type="text/css" href="css/my-style-file.css<?php echo $gzip_string;?>" /> <script type="text/javascript" ...

Why Indian PHP Development Companies Deliver Cost-Effective Solutions

In the world of web development, PHP remains one of the most popular programming languages, powering a vast majority of websites and applications. Businesses across the globe seek PHP Development Services to build scalable, secure, and high-performing web solutions. Indian PHP development companies have gained global recognition for delivering cost-effective solutions without compromising on quality. But what makes India a preferred destination for PHP development? Let’s explore the factors that contribute to the cost-effectiveness of Indian PHP development companies. 1. Competitive Labor Costs One of the primary reasons Indian PHP development companies can offer cost-effective solutions is the competitive labor cost. India has a vast talent pool of skilled PHP developers who are available at a fraction of the cost compared to developers in Western countries such as the United States, the United Kingdom, and Australia. This cost advantage allows businesses to allocate budgets more eff...