当前位置: 首页>>代码示例>>PHP>>正文


PHP link::findAllBy方法代码示例

本文整理汇总了PHP中link::findAllBy方法的典型用法代码示例。如果您正苦于以下问题:PHP link::findAllBy方法的具体用法?PHP link::findAllBy怎么用?PHP link::findAllBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在link的用法示例。


在下文中一共展示了link::findAllBy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index($urlfriendly = null, $page = 1, $vistas = false)
 {
     $this->plugin->call('index_load');
     $page = (int) is_null($page) ? 1 : $page;
     $C = new configuration();
     $P = new post();
     $L = new link();
     $urlfriendly = rawurlencode($P->sql_escape($urlfriendly));
     //Sanitize
     $codice = $C->getBlogConfiguration();
     $title_for_layout = $codice['blog_name'];
     $links = $L->findAllBy("type", "internal");
     //links para el sidebar
     $single = $urlfriendly ? true : false;
     $this->registry->single = $single;
     if ($urlfriendly) {
         $post = $P->getPost($urlfriendly, 'publish');
         $posts = null;
         if ($P->isNew() === false) {
             $title_for_layout = $post["title"];
             $busqueda = null;
             $pagination = null;
         } else {
             $title_for_layout = "Búsquedas";
             $posts = $P->busqueda($urlfriendly);
             $busqueda = true;
             $pagination = null;
             $single = false;
         }
     } else {
         $total_rows = $P->countPosts();
         $limit = $codice['blog_posts_per_page'];
         $offset = ($page - 1) * $limit;
         $limitQuery = $offset . "," . $limit;
         $targetpage = $this->path . 'index/page/';
         $busqueda = null;
         $pagination = $this->pagination->init($total_rows, $page, $limit, $targetpage);
         $post = null;
         $posts = $P->getPosts("publish", $limitQuery);
     }
     //Creamos los tags <meta> que van dentro del layout.
     $includes = array();
     $includes['charset'] = $this->html->charsetTag("UTF-8");
     $includes['rssFeed'] = $this->html->includeRSS();
     if ($page > 1) {
         $includes['canonical'] = $this->html->includeCanonical("/index/page/{$page}");
     } else {
         if ($urlfriendly) {
             $includes['canonical'] = $this->html->includeCanonical($urlfriendly);
         } else {
             $includes['canonical'] = $this->html->includeCanonical();
         }
     }
     $this->registry->includes = $includes;
     $this->plugin->call('index_includes');
     //Convertimos de Array a String, para que pueda ser mostrado en la vista.
     $includes = null;
     foreach ($this->registry->includes as $include) {
         $includes .= $include;
     }
     $this->registry->post = $post;
     $this->registry->posts = $posts;
     $this->plugin->call("index_post_content");
     $this->view->setLayout("codice");
     $this->view->codice = $codice;
     $this->view->urlfriendly = $urlfriendly;
     $this->view->pagination = $pagination;
     $this->view->busqueda = $busqueda;
     $this->view->includes = $includes;
     $this->view->links = $links;
     $this->view->single = $single;
     $this->view->posts = $this->registry->posts;
     $this->view->post = $this->registry->post;
     $this->view->cookie = array('author' => $this->cookie->check('author') ? $this->cookie->author : '', 'email' => $this->cookie->check('email') ? $this->cookie->email : '', 'url' => $this->cookie->check('url') ? $this->cookie->url : '');
     $this->title_for_layout($title_for_layout);
     $this->render("index");
 }
开发者ID:ravenlp,项目名称:CodiceCMS,代码行数:77,代码来源:index_controller.php


注:本文中的link::findAllBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。