Yii
- 128 ответов
- 0 вопросов
119
Вклад в тег
interface ArticleInterface
{
public function getTitle();
public function getAuthor();
}
interface ArticleAuthorInterface
{
public function getName();
public function getID();
}
public function renderArticle(ArticleInterface $article)
{
return $this->renderPartial('_article', [
'author' => $article->getAuthor(),
'title' => $article->getTitle()
]);
}
class Article extends ActiveRecord implements ArticleInterface
{
// ...
}