Skip to content

Instantly share code, notes, and snippets.

@fadib
Last active July 11, 2018 13:18
Show Gist options
  • Save fadib/73cd593f4b2f3e3b538b to your computer and use it in GitHub Desktop.
Save fadib/73cd593f4b2f3e3b538b to your computer and use it in GitHub Desktop.
Yii 1 -> Yii 2
<?php
CHtml::cssFile() => Html::cssFile()
CHtml::scriptFile() => Html::jsFile()
CHtml::link() => Html::a()
CHtml::image() => Html::img()
CHtml::submitButton() => Html::submitButton()
// View
$this->renderPartial() => $this->render()
$this->widget('HelloWidget') => HelloWidget::widget()
$this->clips[] => $this->blocks[]
$this->beginWidget('CActiveForm') => ActiveForm::begin()
$form->labelEx() => $form->field()->label()
$form->textField() => $form->field()->textInput()
$form->dropDownList() => $form->field()->dropDownList()
$form->radioButtonList() => $form->field()->radio()
$form->textArea() => $form->field()->textarea()
$this->createUrl() => Yii::$app->urlManager->createUrl() || Url::toRoute()
Yii::app() => Yii::$app
Yii::app()->request => Yii::$app->request
Yii::app()->request->getParam() => Yii::$app->request->get()
Yii::app()->params[] => Yii::$app->params[]
Yii::app()->theme => Yii::$app->theme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment