Install extensions

Hello,

I’ve installed the basic application example, just by donwloading it.

I would like to test extensions, and widgets, for understand how do them work. Is it better to use Compozer for install them ? Or in witch directory do I have to download them.

For example, for install this one :

http://www.yiiframework.com/extension/weathersmcs/

Thanks a lot,

Cordially,

ANDRE Ani

the best way is use composer, is very easy manage the project dependence and update packages.

read composer

Thanks.

After use composer, they say to add lines to the config/main.php file. But I don’t find this one, don’t have a config directory in the basic app…

If you don’t see config/main.php, then it means that you have failed to install the basic app.

You have to be successful in installing and running the basic app without any extension before you try to test some extension.

Just start step by step, reading the guide:

http://www.yiiframework.com/doc-2.0/guide-start-installation.html

No, the application is running, and I can go to all the pages. All seems good.

In /config, I don’t have main.php but these files :

console.php

db.php

params.php

web.php

I see.

"web.php" is what you have to edit.

Ok, thanks.

I’m trying this :

http://www.yiiframework.com/extension/yii-feed-widget

I’ve downloded the directory in /vendor

But I have an error :




yii\base\UnknownMethodException

Calling unknown method: yii\web\View::widget()

I have this in my /config/web.php :


$config = [

    'id' => 'basic',

    'basePath' => dirname(__DIR__),

    'bootstrap' => ['log'],

    

    

    'controllerMap'=>array(

     'YiiFeedWidget' => 'ext.yii-feed-widget.YiiFeedWidgetController'

),

    

    'components' => [

And simply this in my view :


<?php 

$this->widget(

   'ext.yii-feed-widget.YiiFeedWidget',

   array('url'=>'http://www.mysite.com/feed','limit'=>3)

); 

?>

What I’m doing wrong ?

Ah, um, OK. I’m sorry, but I have overlooked an important thing.

Both of the extensions that you wanted to try are for Yii 1.1. They are not meant to be used with Yii 2.0.

You have to consider using Yii 2.0 compatible extensions if there are any.

Or, you have to use Yii 1.1 for the sake of those extensions that you want to use.

Ok. I didn’t notice this…

This extension is ok with Yii 2 :

http://www.yiiframework.com/extension/yii2-system-info/

But I don’t know how to use it. Do I just have to copy / paste these lines in a view after installation ?

Because it’s not working.

I’ve got this :




yii\base\ErrorException

Class 'SystemInfo' not found

Perhaps not installed in the good directory ?