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

434 questions
2
votes
2 answers

Where are the routes for Gii defined in Yii framework?

I created a Yii application in the webroot. I enabled the Gii module and modify the .htaccess to remove the index.php part in the url. I also have the urlManager component defined in the config/main.php configuration file. 'urlManager' => array( …
bobo
  • 8,439
  • 11
  • 57
  • 81
2
votes
1 answer

Yii CUserIdentity vs a User Model

I have at least one model in my Yii project that will need to reference a particular user ID. In my SQL for the model I have something like CONSTRAINT FOREIGN KEY (user_id) REFERENCES User(id). I was going to go ahead and create a User model when I…
tacos_tacos_tacos
  • 10,277
  • 11
  • 73
  • 126
2
votes
1 answer

Yii1 action doesn't get $_POST from postman

I'm using Yii 1, and testing an API i'm working on, and when i POST to this URL https://blabla.com/products/report/notification I get nothing on postman My Filters public function filters() { return array( 'accessControl', //…
Shaho
  • 157
  • 3
  • 15
2
votes
3 answers

Inserting Active Record Data into Yii's CGRidView widget

I have a table in mysql that I want to display with the CGridView widget. Here is my code thus far: My Controller file (snipped of course): public function actionIndex() { //call the AR table model $model = new ViewResults(); //This generates…
k to the z
  • 3,217
  • 2
  • 27
  • 41
2
votes
0 answers

Yii Cache, CDbCommand::execute() fail: SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: YiiCache.id

I'm getting the following error with Yii cache CDbCommand::execute() fail: SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: YiiCache.id. La sentencia SQL ejecutada fue: INSERT INTO YiiCache (id,expire,value)…
e-israel
  • 623
  • 10
  • 30
2
votes
0 answers

Yii2 login not working when debug module is not loaded

We have a working Yii2 app that was Frankensteinized using Yii1's old version as a base then updated to Yii2. Of course there were a lot of problems and I managed to fix most, however there is a problem that keeps evading me. As soon as we switch…
NaturalBornCamper
  • 3,675
  • 5
  • 39
  • 58
2
votes
1 answer

Yii2: How to override the yii\db\Query class to add default conditions with queries

I want to make a cloud-based application where I store the application id and branch_id in session and I want to add the application_id and branch_id to each DB query. Easy I am overriding the find() using public static function find() { …
rajwa766
  • 604
  • 13
  • 31
2
votes
0 answers

How to override/extend the namespace methods, with using \Yii::$classMap

How to override/extend the namespace methods, with using \Yii::$classMap I want to override/extend the beforeAction($action) method for yii\base\Controller, like this. namespace yii\web; class Controller extends \yii\web\Controller { public…
2
votes
0 answers

How to add username in url before controller/action in yii2

I'm working on a site and I need to customize site URL in such a manner that it will work like // after login the user. I have tried it with followings rules in Yii 2.0 configuration file:- 'rules' => [ …
2
votes
1 answer

How to configure Yii2 component to use op_cache?

Yii2 documentation suggests the following configuration which is applicable for memCache. 'components' => [ 'cache' => [ 'class' => 'yii\caching\MemCache', 'servers' => [ [ 'host' => 'server1', …
Thiyaga Raj
  • 105
  • 3
  • 12
2
votes
2 answers

Yii2 Basic - How I use common function functionality in yii2 action

I am new to YII use yii2 basic.actually i want to know How to call an common function from action of the same controller. Suppose I am in action A for send mail. I need to call send mail function B with three parameters its reurns some value. My…
Daniyal
  • 184
  • 5
  • 24
2
votes
1 answer

How to set logFile path dynamically for different modules in yii

I want to set different logpath for each module so that all errors, warnings, should be categorize with module name as parent folder. i.e…
Innam Hunzai
  • 442
  • 1
  • 6
  • 17
2
votes
2 answers

Unable to find backend\models\QuoteDocs namespace missing

Dynamic form Yii2, getting error "Unable to find 'backend\models\QuoteDocs' in file: C:\xampp\htdocs\taskmanagement/backend/models/QuoteDocs.php. Namespace missing?" when I am trying to write backend\models\QuoteDocs I am getting following…
Nayank
  • 101
  • 1
  • 3
  • 14
2
votes
1 answer

Can you format the style of the DropDownList in yii2?

Can you format the style of the DropDownList in yii2 I have the following code that generates a list from a table and I wanted to change the text size and color of the items to choose from.
samauto
  • 137
  • 2
  • 15
2
votes
1 answer

How to enhance Yii1 application with Yii2 restfull api?

Have a running Yii1 application. How to enhance Yii1 application with Yii2 restfull api instead of rewriting the whole Yii1 application in Yii 2?