Questions tagged [yii-components]

Yii is an open source, object-oriented, component-based MVC PHP web application framework. Yii is pronounced as "Yee" or [ji:] and it's an acronym for "Yes It Is!"

For more information on Yii components, please see the Yii documentation at:

http://www.yiiframework.com/doc/guide/1.1/en/basics.component

436 questions
30
votes
2 answers

What is the difference between component, extension & module in Yii

I am new to Yii framework, and just came across module, extension & component inside protected folder. Can anyone please differentiate all these theoretically as well as practically also.
Workonphp
  • 1,465
  • 17
  • 21
23
votes
1 answer

When to use components and when to use extensions in Yii?

I'm a little bit confused about the purpose of components and extensions folders in protected/ Please clarify.
oaziz
  • 1,342
  • 1
  • 16
  • 31
16
votes
3 answers

Difference in between Modules and extension in Yii

I want to know what is the difference in between modules and components in Yii Framework. I have googled so much but not got any good results. So can some one will help me out to know that. Any help and suggestions will be highly appreciable.
NewUser
  • 11,759
  • 36
  • 127
  • 221
16
votes
6 answers

How to validate email and email already exist or not check, in Yii Framework?

How to validate email using Yii Model validation rules function code. Also how to check email exist or not using Model validation rules function in Yii.
george
  • 201
  • 1
  • 3
  • 6
13
votes
2 answers

Yii's magic method for controlling all actions under a controller

Commando need's help from you. I have a controller in Yii: class PageController extends Controller { public function actionSOMETHING_MAGIC($pagename) { // Commando will to rendering,etc from here } } I need some magic method under…
user798596
11
votes
3 answers

yii2 framework message language

As you know in Yii2 the core messages are available in 26 languages. I want to change yii core message language to display validation message in my language. I added this line to my config file: 'language' => 'fa_IR', and also added this…
b24
  • 2,345
  • 6
  • 28
  • 50
10
votes
5 answers

Getting Current Controller ID in Yii

I want to get the current controller name that handles the current action. but the in my case I will look for the current controller in my main.php in my layout files. this is my small view of my directory structure to give you an idea where is my…
Netorica
  • 16,405
  • 16
  • 70
  • 105
10
votes
2 answers

How add CJuiDatePicker in JQRelcopy on Yii Framework

I have a problem with CJuiDatePicker in the module JQRelcopy on Yii framework. I use this module as I have a form with a datepicker field to be copied as many times as the user wishes. The module works fine if I put a normal field (without…
Florent
  • 761
  • 1
  • 10
  • 24
10
votes
1 answer

Yii add filter to a virtual attribute in CGridView and make it sortable

I have the following Models : User with columns {id,user_name,password,user_type} Admin with columns {id,user_id,full_name,.....etc} Editor with columns {id, user_id,full_name,...etc} and the relations are User : 'admin' => array(self::HAS_ONE,…
dInGd0nG
  • 4,108
  • 1
  • 21
  • 35
9
votes
9 answers

How to write global functions in Yii2 and access them in any view (not the custom way)

Yii1.1 had a CComponent class that had a CBaseController which was the base class for CController. There was a /protected/components/Controller.php class which enabled any function in that class to be accessed in any view. Yii2 no longer possess the…
intumwa
  • 214
  • 2
  • 3
  • 12
9
votes
1 answer

Run single migration (not newest) in Yii

I have few migrations files.How can I run single migration down or up, if this migration isn't the newest, but some steps in the migrations history? When I run yiic migrate up 1, it runs the latest migration. Running migration command using…
Thomas
  • 495
  • 10
  • 16
8
votes
2 answers

Where should I put my custom widget files in Yii framework?

From this page, http://www.yiiframework.com/wiki/23/how-to-create-a-breadcrumb-widget/ It seems it suggests that we should put the files in the component folder. But if my widget contains javascript and css files, where should these files be…
bobo
  • 7,641
  • 10
  • 54
  • 80
7
votes
3 answers

Yii2 REST+ Angular Cross Domain CORS

I have developed Angular & Yii2 REST service. Have problem in cross domain. Here below add my angular & Yii2 REST Code. AngularJs : (like 'http://organization1.example.com','http://organization2.example.com',....) $http.defaults.useXDomain =…
ArivuAjay
  • 135
  • 2
  • 11
7
votes
4 answers

DropDownList yii 2.0 example

I am using yii 2.0 Framework. How i can make options from my database. I found this, but it's yii 1.1: 'Male', 'F' => 'Female')); I want to pass it to form:
pvaitonis
  • 1,277
  • 2
  • 16
  • 39
7
votes
3 answers

Yii2 Multiple instances of the same model

I want to get multiplie instance of the same model in my controller. I saw this wiki for Yii 1.1 and tried like that but in my code only last instance in form was acceble from controller my code is here (I commented code with error and variable…
b24
  • 2,345
  • 6
  • 28
  • 50
1
2 3
29 30