當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Versioned::inline_diff方法代碼示例

本文整理匯總了PHP中Versioned::inline_diff方法的典型用法代碼示例。如果您正苦於以下問題:PHP Versioned::inline_diff方法的具體用法?PHP Versioned::inline_diff怎麽用?PHP Versioned::inline_diff使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Versioned的用法示例。


在下文中一共展示了Versioned::inline_diff方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: action_diff

 /**
  * Show inline difference between two versions
  */
 public function action_diff()
 {
     Kohana::$log->add(Kohana::DEBUG, 'Executing Controller_Admin_Article::action_diff');
     $this->template->content = View::factory('blog/admin/article_diff')->bind('article', $this->_resource)->bind('ver1', $ver1)->bind('ver2', $ver2)->bind('diff', $diff);
     // Bind locally
     $article =& $this->_resource;
     $ver1 = $this->request->param('ver1');
     $ver2 = $this->request->param('ver2');
     // Get versions of the text
     $article->version($ver2);
     $new_text = $article->text;
     $article->version($ver1);
     $old_text = $article->text;
     $diff = Versioned::inline_diff($old_text, $new_text);
 }
開發者ID:vimofthevine,項目名稱:kohana-blog,代碼行數:18,代碼來源:article.php

示例2: testInlineComparison

 /**
  * Test inline comparison
  */
 public function testInlineComparison()
 {
     $diff = Versioned::inline_diff($this->text1, $this->text2);
     $this->assertRegExp('/<ins>unoriginal<\\/ins>/', $diff);
     $this->assertRegExp('/<del>original<\\/del>/', $diff);
 }
開發者ID:vimofthevine,項目名稱:versioned,代碼行數:9,代碼來源:UnitTest.php


注:本文中的Versioned::inline_diff方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。