Skip to main content

Posts

Showing posts with the label Yii Developer in India

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

How to Use Two Database in Yii PHP Framework

Recently in one of Ireland based project client has requirement to use existing Microsoft SQL Server database and implement new feature and store data into MySQL database with Yii Framework. First we have  install 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