Below I have created an Html helper with methods to help me locate directories of my assets dynamically. Such assets may include CSS, JavaScript and images.
Below I have created an Html helper with methods to help me locate directories of my assets dynamically. Such assets may include CSS, JavaScript and images.
In this post I am going to describe a solution to make your yii-based web application safe from illegal content injections.
In this tutorial we will be setting up a content type to be ordered by weight using the JUI Sortable plugin.
Add these lines in /config/main.php
'components'=>array(
.........
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=database1',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'itsasecret',
'charset' => 'utf8',
),
'db2'=>array(
'class' => 'CDbConnection',
'connectionString' => 'mysql:host=localhost;dbname=databa...
In order to nicely display flash Messages, create view like this called views/site/dialog.php :
This tutorial shows you how to safely remove records between relationships.
To extend the functionality of you web application relative to your requirements you are supposed to use existing yii core libraries or use external libraries. There are some steps to ensure security, uniqueness, modularity, performance and to avoid rework in future.
I can see many questions regarding configuring the path using Windows OS. I could hardly get the right information about it. The cook book has defined for Linux. So I would like to share my idea on it. To configure the Yii path using Windows OS,
The yii2-detail-view extension offers you an easy way to EDIT and VIEW your model data, toggle these modes, and adds other features. You can read the extension documentation and/or view a demo of this extension, to understand usage.
}
`
V. The Order model would start with:
class Order extends CActiveRecord
{
const STATUS_INITIATED = 1;
const STATUS_CANCELED = 2;
const STATUS_EXPIRED = 3;
const STATUS_PAID = 4;
public $statuses = array(
self::STATUS_INITIATED => 'Initiated',
self::STATUS_CANCELED => 'Canceled',
self::STATUS_EXPIRED => 'Expired',
self::STATUS_PAID => 'Paid',
);
// more cod...
View file
Create param.php file in protected/config
Yii::app()->params['TEXT_ACTIVE'] = 'Active'; //1 for active
In this wiki I will show how to copy a schema from a database to another one
Use SQL SERVER 2000, the date format not like: yyyy/mm/dd hh:mm:ss. So I change to use SQL SERVER 2008 EXPRESS.
If you have read this wiki you would be aware of the yii2-detail-view extension and how it offers you an easy way to EDIT and VIEW your model data, toggle these modes, and other features. You can [read the extension documentation](http://demos....
Suppose you have Products,Categories and each product belongs in many categories
This is second article with my tutorial. I had to add it, because Wiki article has limited length and as I was extending it's text, older paragraphs were disappearing. So here I am starting from chapter 6.
In this wiki I will show how to Disallowing login from multi places. User can login or access their account at time, only single place.
First, you have to have create database table for default language and allowed languages.
CREATE TABLE IF NOT EXISTS `tbl_languages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`lang` varchar(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`flagpath` varchar(40) CHARACTER SET utf8 COLLATE utf8_unicode_...