ANDRE_Ani
(Patr And)
September 4, 2015, 4:33pm
1
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
Bushi
(Pedroguarimata)
September 4, 2015, 6:42pm
2
the best way is use composer, is very easy manage the project dependence and update packages.
read composer
ANDRE_Ani
(Patr And)
September 5, 2015, 2:18am
3
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…
softark
(Softark)
September 5, 2015, 7:19am
4
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
ANDRE_Ani
(Patr And)
September 5, 2015, 3:41pm
5
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
softark
(Softark)
September 5, 2015, 11:34pm
6
I see.
"web.php" is what you have to edit.
ANDRE_Ani
(Patr And)
September 6, 2015, 7:29am
8
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 ?
softark
(Softark)
September 6, 2015, 10:56am
9
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.
ANDRE_Ani
(Patr And)
September 6, 2015, 4:59pm
10
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 ?