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
3 answers

Adding an expression in htmlOptions of CGridView

I'm trying to set the htmlOptions using a value from the array used as DataProvider of the CGridView component (it's a CArrayDataProvider). In it there is a flag that will be either 0 or 1 (0 for font-weight: normal and 1 for…
Elathan
  • 71
  • 1
  • 7
2
votes
1 answer

Yii AccessRules Pass Parameter to Callback function in expression

I am developing an application in YII modules based Need to restrict users on certain actions as well as on entire module I was able to restrict the users using 'expression' + callback in rules but now I want to use the same callback function for…
Junaid
  • 2,084
  • 1
  • 20
  • 30
1
vote
4 answers

yii. Accessing a function from a modules controller

I have a module in my app and under its default controller it has a function called renderPageLinks which returns a array for consumption by a widget. The widget, genMenu, is called from /themes/jui/views/layouts/main.php (it generates a menu) I…
Tom T
  • 432
  • 1
  • 7
  • 21
1
vote
1 answer

activeCheckBox click on checkbox but still marked as unchecked and not change in $_POST yii

I want to load data depending on checkbox and tried this way. echo CHtml::activeCheckBox($model,'State', array('ajax'=>array('url'=>$this->createUrl('ad/AllState'),'type'=>'POST'))); When I checked the checkbox, there are two issues Checkbox…
kashan
  • 101
  • 7
1
vote
3 answers

Can I execute two or more sql statement using yii CSqlDataProvider?

I am trying to get few result on following sql statements using yii, But there are something wrong....!!! $sql="SET @pStat=-1; SET @pdt=0; SELECT * FROM (SELECT !li.gen AS id,li.logAt, getDuration(gen,logAt) AS duration FROM os_loggerinfo li ) AS…
Habibul Morsalin
  • 180
  • 1
  • 11
1
vote
2 answers

Generating CRUD Code through Yii giving error

i have completely done all the task that is Model generator Crud generator after that when there come try the link i click that link it gives the following error YiiBase::include(Controller.php) [
Fawad Ghafoor
  • 6,039
  • 7
  • 41
  • 53
1
vote
1 answer

sending mail from yii

public function mailsend($name, $contact_no, $email,$website,$content,$subject,$address ) { $message = new YiiMailMessage; $message->view = 'viewfilenm'; $message->setBody(array(), 'text/html'); $body =…
User1988
  • 1,965
  • 4
  • 25
  • 47
1
vote
1 answer

what is the purpose of a component (class) in Yii

I do not understand the Component piece used in the Yii FW. Is there a concrete (real life) example why I should use that?
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
1
vote
1 answer

Google reCAPTCHA v2 on Yii1.1.6 not shown

I'm trying to make google reCaptcha on my projects that used Yii 1.1.6. And I already follow this documentation https://github.com/dakiquang/yiiReCaptcha. But my google reCaptcha is not shown. Anybody can help, please? This is my loginForm.php…
Bin Ski.
  • 849
  • 1
  • 8
  • 10
1
vote
2 answers

what is the best way to render CJuiDatePicker as form element using CForm builder with array of elements?

I have a CForm builder code in my action: $form = new CForm( 'application.components.portlets.views._newClientForm', $model ); and array of input elements: array( …
RusAlex
  • 8,245
  • 6
  • 36
  • 44
1
vote
1 answer

Effective pagination of decreasing results

I'm working for a client who asks me to prepare a module for its website (written using Yii) with the following features: It shows 3 elements from a mysql_result, starting from offset=0. The user can click on any of them to mark them as "read".…
Sergi Juanola
  • 6,531
  • 8
  • 56
  • 93
1
vote
1 answer

What is local component in Yii2?

In the documentation "info" section Yii 2 says: Using too many application components can potentially make your code harder to test and maintain. In many cases, you can simply create a local component and use it when needed. What is local…
Oleg
  • 21
  • 4
1
vote
1 answer

SQLSTATE[HY000] [1049] on YiiFramework

$ yii migrate Yii Migration Tool (based on Yii v2.0.13-dev) Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [1049] Unknown database 'yii'' in E:\laragon\www\website\vendor\yiisoft\yii2\db\Connection.php:586 Stack trace: #0…
1
vote
2 answers

How to send multiple settextbody yii2 send mail?

Hi I've trying to make a form that can send email using yii/mail, the problem is I only can send one form to become text body, I've code the models like this: class CareerForm extends Model { public $name; public…
unknown.person
  • 135
  • 2
  • 11
1
vote
2 answers

Retrieving data while user is typing

I have five text fields in my page and when the user types something in first textfield, I need to retrieve the values based on the first textfield. Right now, I have hardcode the value as 121, which is returning the value properly from DB, but how…
user2431170
  • 151
  • 2
  • 11