Helpers 助手

Kohana的许多静态的 “Helper” 功能来使某些任务变得更加容易。 原文

也可以通过建立一个类并把 它放入 classes 目录来实现自己的 helper,也可以扩展任何 helper 利用透明扩展来修改或添加新函数。 原文

  • [Arr] - Array functions. Get an array key or default to a set value, get an array key by path, etc.

  • [CLI] - Parse command line options.

  • [Cookie] - Covered in more detail on the Cookies page.

  • [Date] - Useful date functions and constants. Time between two dates, convert between am/pm and military, date offset, etc.

  • [Encrypt] - Covered in more detail on the Security page.

  • [Feed] - Parse and create RSS feeds.

  • [File] - Get file type by mime, split and merge a file into small pieces.

  • [Form] - Create HTML form elements.

  • [Fragment] - Simple file based caching. Covered in more detail on the Fragments page.

  • [HTML] - Useful HTML functions. Encode, obfuscate, create script, anchor, and image tags, etc.

  • [I18n] - Internationalization helper for creating multilanguage sites.

  • [Inflector] - Change a word into plural or singular form, camelize or humanize a phrase, etc.

  • [Kohana] - The Kohana class is also a helper. Debug variables (like print_r but better), file loading, etc.

  • [Num] - Provides locale aware formating and english ordinals (th, st, nd, etc).

  • [Profiler] - Covered in more detail on the Profiling page.

  • [Remote] - Remote server access helper using CURL.

  • [Request] - Get the current request url, create expire tags, send a file, get the user agent, etc.

  • [Route] - Create routes, create an internal link using a route.

  • [Security] - Covered in more detail on the Security page.

  • [Session] - Covered in more detail on the Sessions page.

  • [Text] - Autolink, prevent window words, convert a number to text, etc.

  • [URL] - Create a relative or absolute URL, make a URL-safe title, etc.

  • [UTF8] - Provides multi-byte aware string functions like strlen, strpos, substr, etc.

  • [Upload] - Helper for uploading files from a form.