How to Connect yii2 with mongodb

Published on

MongoDb Extension for Yii 2 Installation Configuration This extension provides the MongoDB integration for the Yii framework 2.0. For license information check the LICENSE-file. Installation This extension requires MongoDB PHP Extension version 1.5.0 or higher. The preferred way to install this extension is through composer. Either run php composer.phar require –prefer-dist yiisoft/yii2-mongodb or add “yiisoft/yii2-mongodb”: … Continue reading How to Connect yii2 with mongodb

How to use events in yii2

Published on

For “global” events. Optionally you can create a specialized event class namespace your\handler\Event\Namespace; class EventUser extends Event { const EVENT_NEW_USER = ‘new-user’; } define at least one handler class: namespace your\handler\Event\Namespace; class handlerClass{ // public AND static public static function handleNewUser(EventUser $event) { // $event->user contain the “input” object echo ‘mail sent to admin for’. … Continue reading How to use events in yii2

How to Enable clean URL in Yii2

Published on

First important point is that Module_Rewrite is enabled on your server(LAMP,WAMP,XAMP..etc) For do URL rewiring in yii2 framework Create one .htaccess file and put in /web folder RewriteEngine on # If a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Otherwise forward it to index.php RewriteRule . index.php … Continue reading How to Enable clean URL in Yii2

how to integrate twitter bootstrap with yii

Published on

Setup Download the latest release from Yii extensions by following the link below: Download Yii-Bootstrap Unzip the extension under protected/extensions/bootstrap and modify your application configuration accordingly: If you wish to use the provided Bootstrap theme copy the theme directory to your themes directory. // Define a path alias for the Bootstrap extension as it’s used … Continue reading how to integrate twitter bootstrap with yii

yii How to Creating Pdf Report / Excel Report

Published on

yii How to Creating Pdf Report / Excel Report, Create report,pdf, Excel Please create new function in your models or you can see in the below: In your model | e.g. : models/Items.php public function getMyreport() { $from=$_REQUEST[‘from’]; $until=$_REQUEST[‘until’]; $sql=”SELECT * FROM items where CREATED_DATE >= ‘$from’ and CREATED_DATE <= ‘$until’ order by ITEM_ID desc … Continue reading yii How to Creating Pdf Report / Excel Report

Dynamically Change Yii2 Theme

Published on

Dynamically Change YII2 Theme, change theme in yii2 framework. Here you can learn how to change theme in yii2 Dynamically. Create a themes directory in web folder in frontend or backend where you want to change theme. place your theme folder inside themes directory. change $css and $js variables in AppAsset.php in assets folder in frontend or … Continue reading Dynamically Change Yii2 Theme

Yii2 Tutorial For Beginners

Published on

YII2 Basic Tutorial For Beginners.YII2 For Beginners. Here Beginners can learn yii2 tutorial step by step. yii2 step by step tutorial. yii2 beginner tutorial. learn yii2 framework step by step. yii2 step by step tutorial. yii2 complete tutorial How to Program With Yii2: Getting Started Today Yii Framework made the announcement that Yii2 was now available for a public … Continue reading Yii2 Tutorial For Beginners