Questions tagged [yii-events]

Yii is a high-performance, component-based, open source PHP framework best for developing Web 2.0 applications. It is one of only few PHP frameworks that supports EDP (Event-Driven Programming) and this tag contains questions that are specific to events in Yii.

89 questions
2
votes
1 answer

CGridView Sorting with relational table sorts by relaton Id parameter

I have problem in CGrid while on sorting a relational data using relational model in `` page. Briefly my scenario: I have a user model: Entities=> id,username And a profile Model: Entities=> id, firstname,lastname, user_id,etc.. I want to list…
tnchalise
  • 1,573
  • 2
  • 18
  • 38
2
votes
2 answers

Button image is not working properly

I recently added a image to the edit button in YII.I do the following, 'class'=>'CButtonColumn', 'header' => 'Edit', 'template' => '{Edit}', 'buttons' => array( 'Edit' =>array( 'label' => 'Edit', …
tnchalise
  • 1,573
  • 2
  • 18
  • 38
2
votes
1 answer

FORM POST with in a javascript function

I have a form like this.. beginWidget('CActiveForm', array( 'id'=>'price-form', 'enableAjaxValidation'=>true, 'enableClientValidation'=>true, )); ?> And a submit buttom like this..
tnchalise
  • 1,573
  • 2
  • 18
  • 38
2
votes
1 answer

HTML Button calling controller/action

I am trying to create html button in Yii on button click I want to call a UserController.php and Actioncreate . I am doing like this , echo CHtml::button('Signup', array('button' => array('Users/create'))); ?> But it's giving me following error…
Shumaila Khan
  • 91
  • 1
  • 5
  • 19
2
votes
2 answers

Doing calculation in Yii is only taking manually inserted values

I am writing a small invoice application in Yii. I have the database for the model item. The item database is something like this +++++++++++++++++ | InvoiceItems | +++++++++++++++++ + id + + name + + description …
NewUser
  • 12,713
  • 39
  • 142
  • 236
2
votes
2 answers

Facing difficulties to activate user registration by email in Yii

I am facing problem to activate an user by click on activation link that sent by email. After click on activation link i.e. http://www.example.com/devtest/index.php?r=user/check&activationcode=bc74873d0e3f684d3e6b99a36169a793ee688406 then it…
user1216487
2
votes
1 answer

How to Split a form in subsections in yii to achieve partial submit of a single form

i have a model with all the fields about user info. and with crud generator i created views and modified the view, form view, as below Here i have hidden the editing profile part and when user clicks on edit it shows popup and editfields options.…
Bipin Chandra Tripathi
  • 2,550
  • 4
  • 28
  • 45
1
vote
0 answers

Foreign Key not storing in Yii

I have adatabase like this ====Group===== id name ====Member==== id group_id firstname lastname membersince Now as group_id is foreign key then when I will save Group tabale then the group_id should be save with that number. In relations I have…
Jagdish
  • 259
  • 1
  • 8
  • 19
1
vote
3 answers

Yii2 Events: How to add multiple event handlers using behavior's events method?

Here is my Behavior's class events() method. When I trigger an event second handler i.e. sendMailHanlder gets called and it ignores anotherOne. I believe, the second one overwrites first one. How do I solve this problem so that both event handlers…
Ejaz Karim
  • 3,676
  • 6
  • 36
  • 49
1
vote
0 answers

How to extends CBehavior when using massLogout

I have made a file applicationBehavior.php which are in the component folder, like this : 'massLogout', …
Bertho Joris
  • 1,483
  • 5
  • 27
  • 60
1
vote
0 answers

Yii Prioritize a same date and time

Hye there how do i prioritize if there are same date and time. For example i have 2 users press a button on a same date and time. Therefore in my database i have two values with the same date and time. Now what i want is to prioritize which is the…
AsySyah
  • 21
  • 1
  • 6
1
vote
0 answers

Yii - scopes applied after beforeFind in relation

I created a test scope that adds some test condition to DB criteria and applied it in X::model()->with('Y:test')->findByPk(1) By dumping DB criteria in beforeFind I can see the condition is not added there, however by logging the sql query I can see…
user294034
  • 323
  • 1
  • 2
  • 9
1
vote
2 answers

How to use transactions in Yii event

I know, how to use transactions in pure DAO or in ActiveModel, where transaction is initiated before call to $model->save() and rolled back upon any exception. But how to use transactions, if the only place of code I have access to (no matter, why)…
trejder
  • 17,148
  • 27
  • 124
  • 216
1
vote
1 answer

How does Yii event handling work?

I am not quite sure if a hook system and Yii's event handling system is the same. Regarding to this and this documents you have to attach an event to a class and somewhere in the code you have to raise this event. But in my understanding a hook…
Jurik
  • 3,244
  • 1
  • 31
  • 52
1
vote
0 answers

How RaiseEvent Event Functions Just In One Place in Yii Framework CComponent

as You know for making System Event Based You Should create Event Functions for Each of them so this is sample: in Controller which Extended CComponents i create function: public function onDashboardInit($event) { …