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


PHP valid::month方法代码示例

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


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

示例1: day

 public function day($tool_id, $date)
 {
     if (empty($date)) {
         Event::run('system.404');
     }
     $date = explode('-', $date);
     # strictly need the formated date, else throw page not found.
     if (3 != count($date)) {
         Event::run('system.404');
     }
     list($year, $month, $day) = $date;
     valid::year($year);
     valid::month($month);
     valid::day($day);
     $events = ORM::factory('calendar_item')->where(array('fk_site' => $this->site_id, 'calendar_id' => $tool_id, 'year' => $year, 'month' => $month, 'day' => $day))->find_all();
     $primary = new View('public_calendar/small/day');
     $primary->events = $events;
     $primary->date = "{$year} {$month} {$day}";
     $primary->logged_in = $this->client->can_edit($this->site_id) ? TRUE : FALSE;
     return $primary;
 }
开发者ID:plusjade,项目名称:plusjade,代码行数:21,代码来源:calendar.php

示例2: show_archive

 private function show_archive($tool_id, $value, $value2)
 {
     $view = new View("public_blog/blogs/archive");
     $date_search = false;
     # year search
     if (!empty($value) and empty($value2)) {
         valid::year($value);
         $start = $value;
         (int) ($end = $value + 1);
         $date_search = "AND created >= '{$start}' AND created < '{$end}'";
     } elseif (!empty($value) and !empty($value2)) {
         valid::year($value);
         valid::month($value2);
         $month = $value2 + 1;
         if (10 > $month) {
             $month = "0{$month}";
         }
         $start = "{$value}-{$value2}";
         $end = "{$value}-{$month}";
         $date_search = "AND created >= '{$start}' AND created < '{$end}'";
     }
     $blog_posts = $this->db->query("\n      SELECT blog_posts.*, \n      DATE_FORMAT(created, '%Y') as year,\n      DATE_FORMAT(created, '%M') as month,\n      DATE_FORMAT(created, '%e') as day\n      FROM blog_posts \n      WHERE blog_posts.blog_id = '{$tool_id}' \n      AND blog_posts.fk_site = '{$this->site_id}'\n      {$date_search}\n      ORDER BY created\n      LIMIT 0, 10\n    ");
     $view->blog_posts = $blog_posts;
     return $view;
 }
开发者ID:plusjade,项目名称:plusjade,代码行数:25,代码来源:blog.php

示例3: month

 /**
  * Month view
  *
  * @param  int  $year
  * @param  int  $month
  */
 public function month($year, $month)
 {
     $this->tab_id = 'browse';
     if (valid::year($year) && valid::month($month)) {
         $this->type = 'month';
         $this->date->setDate($year, $month, 1);
         $this->page_title = text::title($this->date->format('F Y'));
         $this->_build_calendar();
     }
 }
开发者ID:anqqa,项目名称:Anqh,代码行数:16,代码来源:events.php


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