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

how to use SimpleSAMLphp in yii framework?

I have two project in yii framework and I want to use both project using SimpleSAMLphp with SSO. The condition, I need is if I login from the first project, i want access to the second project. Thank you in advance.
7
votes
5 answers

How to create absolute url on Yii https?

I am creating a website which runs on https.. But when i create absolute url using echo Yii::app()->createAbsoluteUrl('site/index'); it always return http://mydomainname.com/site/index. my expected output is…
Mahesh Eu
  • 515
  • 1
  • 6
  • 21
6
votes
2 answers

CHtml::listData with a complex $textField

I'd like to use a couple of attributes from within a model as textField. Something like this: $form->dropDownList( $formModel, 'ref_attribute', CHtml::listData( User::model()->findAll(array('order'=>'attribute1 ASC, attribute2…
Sergi Juanola
  • 6,531
  • 8
  • 56
  • 93
5
votes
3 answers

How to display rows of CGridView as a link

I want to display CGridView component with all records as a link to its related Update page. I want the functionality of edit button at the end of every row, applied to whole row. If I click anywhere on a particular row, it will redirect me to its…
Darshit Gajjar
  • 746
  • 4
  • 13
  • 26
5
votes
2 answers

Print out a SQL single query (Yii 1.x)

I have a massive query that is generated using CDbCriteria as shown below:- $schema = Yii::app()->db->schema; $builder = $schema->commandBuilder; // how to echo out this query? $command = $builder->createFindCommand($schema->getTable('myuser'),…
Zabs
  • 13,852
  • 45
  • 173
  • 297
5
votes
2 answers

How to perform additional tasks in Yii2 restful controller?

Here is how my RESTful controller looks like.
Viky293
  • 1,250
  • 12
  • 18
5
votes
1 answer

Yii 2.0 How to extend Core Classes

I want to extend the class yii\web\Response. So I created a new class Response in the folder components and I try to overwrite the send method. namespace app\components; use Yii; class Response extends \yii\web\Response{ public function…
Philipp
  • 139
  • 1
  • 2
  • 7
5
votes
2 answers

Override Yii2 assetManager config in controller

I use yii-jui to add some UI elements in the views such as datePicker. In the frontend\config\main-local.php I set the following to change the theme used by the JqueryUI: $config = [ 'components' => [ 'request' => [ // !!!…
SaidbakR
  • 13,303
  • 20
  • 101
  • 195
5
votes
2 answers

Convert this query into CDbCriteria format in Yii

I am still working out the whole functionality of CDbCriteria in Yii 1.x.x - I have a fairly complex SQL query that I want to convert into using the CDbCriteria format with queries within a model (if this is possible with a more complex query. My…
Zabs
  • 13,852
  • 45
  • 173
  • 297
5
votes
3 answers

Yii :: Issue Using Showscriptname = False And Url Manager

I am currently having an issue using the URL manager and/or the apache mod_rewrite or maybe something else entirely. With showScriptName set to false, navigating to addresses such as domain.com/login, domain.com/logout, domain.com/site/login are all…
Owen McAlack
  • 399
  • 10
  • 28
5
votes
3 answers

Disable sorting in header column of Yii CGridView

Yii provides sorting functionality for listing. How can I disable sorting so that my records will not get sorted when clicked on column header?
Rukmi Patel
  • 2,619
  • 9
  • 29
  • 41
5
votes
2 answers

Getting error when using Yii::app()->user->isGuest

I am trying to know if a user is guest using Yii::app()->user->isGuest but I get the following notice: Undefined property: CWebApplication::$user Apparently the component user is not yet defined in the application, I would like to know the…
Mario Marín
  • 131
  • 1
  • 8
4
votes
3 answers

How to apply individual classes for zii.widgets.CMenu labels?

I'm newbie to yii and I want to know: How to apply individual classes(CSS) for zii.widgets.CMenu labels? My code: $this->widget('zii.widgets.CMenu',array( 'items'=>array( …
rdanusha
  • 913
  • 3
  • 15
  • 24
4
votes
2 answers

How to save user password in Hash format into DB in Yii2

I need to create new user. And I want to save password into hash format in DB. But I failed several times. Here is my code: Controller public function actionCreate() { $model = new User(); if ($model->load(Yii::$app->request->post()) &&…
user3265065
4
votes
1 answer

How to disable sort for a column in CGridView?

There is the enableSorting flag, that, if equals false, disable sorting for all grid columns. But how can I do this for just one specific column?
Tasso Evangelista
  • 1,612
  • 1
  • 16
  • 23
1
2
3
28 29