Yii Framework Forum: Migrating app from 1.1 to 2.0 - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Migrating app from 1.1 to 2.0 Migrating app from 1.1 to 2.0

#1 User is offline   Just Greg 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 19-June 17

Posted 19 June 2017 - 09:38 AM

I'm new to this forum and new to yii. I had an application developed from on version 1 and I want to move it to 2 as most of the topic and material I find today is for version 2. I googled this fatal error with no luck. I hope someone can point me in the right direction:

PHP Fatal Error – yii\base\ErrorException

Call to a member function register() on a non-object
1. in C:\inetpub\wwwroot\basic\views\layouts\tpl_header.php at line 11
234567891011121314151617181920<html lang="en">

<head>

<meta charset="utf-8">

<title><?php echo 'Title' ?></title>

<?php Yii::$app->bootstrap->register(); ?>

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta name="description" content="">

<meta name="author" content="Simpson Moyo - Webapplicationthemes.com">


<?php
$baseUrl = Yii::$app->request->baseUrl.'/css/hebo';

$cs = Yii::$app->getClientScript();

Yii::$app->clientScript->registerCoreScript('jquery');


Yii::$app->clientScript->registerScript('helpers', '
baseUrl = '.CJSON::encode(Yii::$app->baseUrl).';
');
?>


<!-- the styles -->

<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl;?>/css/bootstrap.min.css">

<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl;?>/css/bootstrap-responsive.min.css">

<link rel='stylesheet' type='text/css' href='//fonts.googleapis.com/css?family=Pontano+Sans'>

<!--<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl;?>/js/nivo-slider/themes/default/default.css" media="screen" />

2. yii\base\ErrorHandler::handleFatalError()
0

#2 User is offline   Patrick Jones 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 462
  • Joined: 14-July 12
  • Location:Berlin

Posted 19 June 2017 - 12:20 PM

Read this? http://www.yiiframew...de-from-v1.html

Quote

There are many differences between versions 1.1 and 2.0 of Yii as the framework was completely rewritten for 2.0. As a result, upgrading from version 1.1 is not as trivial as upgrading between minor versions.

Life begins outside the comfort zone.
0

#3 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,536
  • Joined: 10-October 10
  • Location:Denmark

Posted 19 June 2017 - 01:24 PM

View PostJust Greg, on 19 June 2017 - 09:38 AM, said:

I'm new to this forum and new to yii. I had an application developed from on version 1 and I want to move it to 2 as most of the topic and material I find today is for version 2. I googled this fatal error with no luck. I hope someone can point me in the right direction


Welcome! Posted Image


As Patrick says: you need to re-write your application.

There is no smooth upgrade path to take from Yii 1 to Yii 2.

The errors you are getting is because the application structure, the classes, interfaces - everything! has changed.

So, basically: you have to change everything.

Sorry! Posted Image
"Less noise - more signal"
0

#4 User is offline   Just Greg 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 19-June 17

Posted 20 June 2017 - 06:59 AM

View PostPatrick Jones, on 19 June 2017 - 12:20 PM, said:


\
Thanks, I've added a short YouTube video to help describe what I do not understand. If you get a second and can watch it and give me feedback, I'd appreciate it.

I have already learned a lot, but at every corner, there is another "gotcha." like $app vs. app().

www.youtube.com/playlist?list=PL7q-X4OkBZCVG424cJc-jn4QbpwwAaaC-
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users