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


PHP Subject::print_name方法代码示例

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


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

示例1: get_names

 public function get_names()
 {
     $temp_subject = new Subject();
     $temp_subject->load($this->subject_id_1);
     $this->subject_1_name = $temp_subject->print_name();
     $temp_subject->load($this->subject_id_2);
     $this->subject_2_name = $temp_subject->print_name();
 }
开发者ID:imonroe,项目名称:coldreader,代码行数:8,代码来源:Relationship_class.php

示例2: array

 $query = $db->prepare("SELECT id, subject_name, date_updated FROM subjects WHERE subject_name LIKE ? ORDER BY subject_name");
 $data = array('%' . $q . '%');
 if ($query->execute($data)) {
     while ($row = $query->fetch()) {
         $output .= '<p><a href="index.php?p=subject_view&id=' . $row['id'] . '">' . $row['subject_name'] . '</a><br /><span class="small">Updated: ' . $row['date_updated'] . '</span></p>';
     }
 }
 // Next, see if the query appears in any aspects, and return the Subject if that's the case.
 $aspect_q = $db->prepare("SELECT * FROM aspects INNER JOIN aspect_types ON aspects.aspect_type=aspect_types.id INNER JOIN subjects_aspects ON aspects.id=subjects_aspects.aspect_id WHERE aspect_data LIKE ?");
 if ($aspect_q->execute($data)) {
     $output .= "<h3>Aspect Results:</h3>";
     while ($row = $aspect_q->fetch()) {
         $ts = new Subject();
         $ts->load($row['subject_id']);
         $output .= '<p>';
         $output .= 'Found in an aspect of ' . $ts->print_name();
         $output .= '</p>';
     }
 }
 // finally, let's query the web.
 $ddg = new DuckAgent();
 $ddg->query($q);
 if (!empty($ddg->result)) {
     $output .= '<h3>From the web:</h3>';
     $websearch = json_decode($ddg->result, true);
     if (isset($websearch['AbstractText'])) {
         $output .= '<p>Abstract: ' . $websearch['AbstractText'] . '<br /> <span class="small">Source: ' . $websearch['AbstractSource'] . '</span></p>';
     }
     if (!empty($websearch['Definition'])) {
         $output .= '<p>Definition: ' . $websearch['Definition'] . '</p>';
     }
开发者ID:imonroe,项目名称:coldreader,代码行数:31,代码来源:search_controller.php


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