Permalink
Browse files

Merge branch 'dev' of github.com:liquidlev/haikwitter into dev

  • Loading branch information...
Matt W
Matt W committed Mar 31, 2012
2 parents e4b0b55 + da05344 commit ee25504a194bd1e0bd088cc27f24ede5c5649189
Showing with 20 additions and 4 deletions.
  1. +1 −4 app/Config/routes.php
  2. +19 −0 app/Controller/PagesController.php
View
@@ -27,10 +27,7 @@
*/
Router::connect('/', array('controller' => 'pages', 'action' => 'add'));
Router::connect('/view/*', array('controller' => 'pages', 'action' => 'view'));
-/**
- * ...and connect the rest of 'Pages' controller's urls.
- */
- Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
+
/**
* Load all plugin routes. See the CakePlugin documentation on
@@ -21,6 +21,11 @@
App::uses('AppController', 'Controller');
+//Text Statistics
+App::import('Vendor', 'Text-Statistics/TextStatistics');
+
+
+
/**
* Static content controller
*
@@ -102,4 +107,18 @@ public function add(){
}
}
}
+
+ public function count($text){
+ echo $this->_syllables($text);
+ }
+
+ private function _syllables($text){
+ $this->layout = false;
+ $this->autoRender = false;
+
+ $text = strip_tags(urldecode($text));
+
+ $statistics = new TextStatistics;
+ return $statistics->syllable_count($text);
+ }
}

0 comments on commit ee25504

Please sign in to comment.