Common.php 938 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Content\Lib;
  3. use Dever;
  4. class Common
  5. {
  6. public function getInfoLink($type, $id)
  7. {
  8. if ($type == 'content/article' || $type == 1) {
  9. return Dever::url('blog_info?id=' . $id, 'main');
  10. } elseif ($type == 'content/album' || $type == 2) {
  11. return Dever::url('photos_info?id=' . $id, 'main');
  12. } elseif ($type == 'content/video' || $type == 3) {
  13. return Dever::url('videos_info?id=' . $id, 'main');
  14. }
  15. }
  16. public function getCateLink($type, $id)
  17. {
  18. if ($type == 'content/article' || $type == 1) {
  19. return Dever::url('blog?id=' . $id, 'main');
  20. } elseif ($type == 'content/album' || $type == 2) {
  21. return Dever::url('photos?id=' . $id, 'main');
  22. } elseif ($type == 'content/video' || $type == 3) {
  23. return Dever::url('videos?id=' . $id, 'main');
  24. }
  25. }
  26. }