Download And Install CKEditor CKEditor With Yii Download And Install CKEditor CKEditor will helpful to create pages with large content. Normally we will use it “CMS” type of website, pages like “About Us”, “Terms and privacy”, etc . First we have to download the CKEditor using below url http://ckeditor.com/download After downloaded it, We have to […]
Category Archives: Yii tips
In my project, I have to hide the delete button from ‘CGridview’ If the record is not related to any other records or table and i have to check the record id, Is it possible or not to delete. Now i created one function ‘is_used()’ in model. This function check this record ‘ID’ is existed […]
This tutorial will help you to display the image in CDetailview widget of yii framework 1.0. We added a different funcitons in model.php to display the image with different methods like only image, image with link, image from database etc. View.php <?php $this->widget(‘zii.widgets.CDetailView’, array( ‘data’=>$model, ‘attributes’=>array( array( ‘name’=>’image’, ‘type’=>’raw’, ‘value’=>$model->image_tag(), ), array( ‘name’=>’imagelink’, ‘type’=>’raw’, ‘value’=>$model->image_with_link(), […]
Here i added the code to “how to set default login url in yii” config/main.php …………… ‘components’=>array( ‘user’=>array( ‘class’ => ‘WebUser’, ‘loginUrl’ => array(‘user/login’), ), ), ……………
In yii framework 1.0, Registers a meta tag that will be inserted in the head section (right before the title element) of the display page. Each call of this method will cause a rendering of new meta tag like keywords, description, robots etc, even if their attributes are equal. Syntax Keywords Description Content-type Cookie ROBOTS […]
Download Extension Print Table Download Extension Using the below link download the extension to take the print of html [Take print What you see]. Click here to download http://www.yiiframework.com/extension/mprint After download, Add the extension into follwoing directory “protected/extension/mPrint/mPrint” Print Table I added sample code to print the some view content <?php $this->widget(‘ext.mPrint.mPrint’, array( ‘title’ => ‘User […]
render renderPartial Another Controller View render render is used to display page with layout or theme. $this->render(‘login’,array(‘model’=>$model)); renderPartial The renderPartial() method is also used for Ajax calls, where the layout isn’t appropriate It will show content of particular view file only and will not include theme files like css, js, header, footer etc.[empty theme content […]
I added the source code for RBAC Module validation. We can check the access role in module level, controller level and action level. add this in config/main.php ‘authManager’=>array( ‘class’=>’CDbAuthManager’, ‘itemTable’=>’authitem’, […]
Normally we will add some fields in every table of application database. Ex createdby, createdon, modifiedby, modifiedon, lasteditedby, lasteditedon etc So we have to configure model for this action. Normally we will add beforeSave() method in every model. Instead of beforeSave in every model, We will create one behavior class and add this beforeSave method. Now we […]
Before save the image into database, i created one ‘text’ field in mysql table to save the image code. We can show the image in CDetailview from database table of yii framework. Here i used showphoto_from_database() function to display the image from database. showproof_from_image_folder() is used to fetch uploaded image url from database and display. […]