monitorbacklinks / yii2-wordpress

Yii2 component for integration with Wordpress CMS via XML-RPC API
http://monitorbacklinks.github.io/yii2-wordpress/
MIT License
33 stars 11 forks source link

It must be an instance of Wordpress, instance of monitorbacklinks\yii2wp\Wordpress given #8

Open josemon123 opened 7 years ago

josemon123 commented 7 years ago

TypeError Argument 1 passed to yii\base\View::{closure}() must be an instance of Wordpress, instance of monitorbacklinks\yii2wp\Wordpress given

this is the used code


$blogPosts = Yii::$app->blog->cache(function (Wordpress $blog) {

                                    // ... queries that use query cache ...

                                    return $blog->noCache(function (Wordpress $blog) {
                                        // this query will not use query cache
                                                return $blog->getPosts();

                                    });
                                });