Thule - 0.9.6
  • Welcome
  • Introduction
  • - MVC(Model-View-Controller)
    - Architecture of Framework
    - Flow Chart of Application
    - Services In One Server
    - Developing Guide
    - Features
  • Installation
  • Getting Started
  • - Direct Access HTTP
    - Router Access HTTP
    - Router Direct Access HTTP
    - Reserved Function
    - Convention
    - Bootstrap
    - Pack Javascript , CSS
  • Basic Modules
  • - Model
    - View
    - Controller
  • Libraries
  • - Router
    - Config
    - Response
    - Request
    - Database
    - Query
    - Cache
    - Debug
    - Log
    - Unit Test
    - Registry
    - Profile
  • Helper
  • - Auth
    - Calendar
    - Date
    - Error page
    - Email
    - Form
    - GeoIP
    - Google
    - Html Element
    - Html
    - Http
    - I18n
    - Image
    - Json
    - Jquery
    - Login
    - Layout
    - Locale
    - PHP to Javascript
    - Paging
    - Payflow
    - Soap
    - Text
    - Table
    - Uri
    - Upload
    - Validation
  • Plugins
  • - Smarty Template Engine
  • History
  • Home > Text

    Text helper is useful to modify the text or sentence.
    You can find more function in Text helper.

    Cutting

    $this->loadHelper('text');
    $this->Text->cut("hello world.",10,"...");
    // hello worl...

    Highlighting string

    $option=array('st'=>'<b>','et'=>'</b>');
    $this->Text->highlight("hello thule, this is thule im thulerealythulebyebye","thule",$option);
    $this->Text->highlight("hello thule, this is thule im thulerealythulebyebye","thule");

    Wordwrap

    $this->Text->wordwrap("hello world hihihihihi.",10);

    Nl2br

    $this->Text->nl2br("hello world \nhihihihihi.",10);

    Html entities

    $this->Text->htmlen("hello world \nhihihihihi.",10);

    Html entity decode

    $this->Text->htmlden("hello world \nhihihihihi.",10);

    Add slashes

    $this->Text->addsl("'hello world \nhihihihihi.",10);

    Keyword Highlight

    This feature will be very useful in search result.

    $this->Text->keywordHighlight("hello", "'hello world \nhihihihihi.",10,array("st"=>"<span\>","et"=>"</span>"));