1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace Drupal\dr8_zth\Controller;
- use Drupal\Component\Utility\Xss;
- use Drupal\Core\Controller\ControllerBase;
- use Drupal\dr8_zth\BlogInterface;
- use Drupal\dr8_zth\BlogTypeInterface;
- use Drupal\taxonomy\TermInterface;
- use Drupal\taxonomy\VocabularyInterface;
- class BlogController extends ControllerBase {
-
- public function addForm(VocabularyInterface $taxonomy_vocabulary) {
- $term = $this->entityManager()->getStorage('taxonomy_term')->create(array('vid' => $taxonomy_vocabulary->id()));
- return $this->entityFormBuilder()->getForm($term);
- }
-
- public function typeTitle(BlogTypeInterface $blog_type) {
- return ['#markup' => $blog_type->label(), '#allowed_tags' => Xss::getHtmlTagList()];
- }
-
- public function blogTitle(BlogInterface $blog) {
- $ret = ['#markup' => $blog->label(), '#allowed_tags' => Xss::getHtmlTagList()];
- ksm($ret);
- return $ret;
- }
- }
|