CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 1.2 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 1.2
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Classes

  • AclBase
  • AclBehavior
  • AclComponent
  • AclNode
  • AclShell
  • Aco
  • AcoAction
  • AjaxHelper
  • ApcEngine
  • ApiShell
  • App
  • AppController
  • AppHelper
  • AppModel
  • Aro
  • AuthComponent
  • BakeShell
  • BehaviorCollection
  • Cache
  • CacheEngine
  • CacheHelper
  • CakeErrorController
  • CakeLog
  • CakeSchema
  • CakeSession
  • CakeSocket
  • ClassRegistry
  • Component
  • Configure
  • ConnectionManager
  • ConsoleShell
  • ContainableBehavior
  • Controller
  • ControllerTask
  • CookieComponent
  • DataSource
  • DbAcl
  • DbAclSchema
  • DbConfigTask
  • DboAdodb
  • DboDb2
  • DboFirebird
  • DboMssql
  • DboMysql
  • DboMysqlBase
  • DboMysqli
  • DboOdbc
  • DboOracle
  • DboPostgres
  • DboSource
  • DboSqlite
  • DboSybase
  • Debugger
  • EmailComponent
  • ErrorHandler
  • ExtractTask
  • File
  • FileEngine
  • Flay
  • Folder
  • FormHelper
  • Helper
  • HtmlHelper
  • HttpSocket
  • I18n
  • I18nModel
  • i18nSchema
  • I18nShell
  • Inflector
  • IniAcl
  • JavascriptHelper
  • JsHelper
  • JsHelperObject
  • L10n
  • MagicDb
  • MagicFileResource
  • MediaView
  • MemcacheEngine
  • Model
  • ModelBehavior
  • ModelTask
  • Multibyte
  • NumberHelper
  • Object
  • Overloadable
  • Overloadable2
  • PagesController
  • PaginatorHelper
  • Permission
  • PluginTask
  • ProjectTask
  • RequestHandlerComponent
  • Router
  • RssHelper
  • Sanitize
  • Scaffold
  • ScaffoldView
  • SchemaShell
  • Security
  • SecurityComponent
  • SessionComponent
  • SessionHelper
  • SessionsSchema
  • Set
  • Shell
  • String
  • TestSuiteShell
  • TestTask
  • TextHelper
  • ThemeView
  • TimeHelper
  • TranslateBehavior
  • TreeBehavior
  • Validation
  • View
  • ViewTask
  • XcacheEngine
  • Xml
  • XmlElement
  • XmlHelper
  • XmlManager
  • XmlNode
  • XmlTextNode

Functions

  • __enclose
  • make_clean_css
  • mb_encode_mimeheader
  • mb_stripos
  • mb_stristr
  • mb_strlen
  • mb_strpos
  • mb_strrchr
  • mb_strrichr
  • mb_strripos
  • mb_strrpos
  • mb_strstr
  • mb_strtolower
  • mb_strtoupper
  • mb_substr
  • mb_substr_count
  • write_css_cache

Class CacheHelper

CacheHelper helps create full page view caching.

When using CacheHelper you don't call any of its methods, they are all automatically called by View, and use the $cacheAction settings set in the controller.

AppHelper
Extended by CacheHelper
Package: cake\cake\libs\view\helpers
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: The MIT License
Location: view/helpers/cache.php

Properties summary

  • $__match public
    array

    Array of string that are replace with there var replace above. The strings are any content inside and includes the tags in views

  • $__replace public
    array

    Array of strings replaced in cached views. The strings are found between in views

  • $_counter public
    integer
    Counter used for counting nocache section tags.
  • $cacheAction public
    object
    cache action time

Method Summary

  • __parseFile() public
    Parse file searching for no cache tags
  • __parseOutput() public
    Parse the output and replace cache tags
  • __writeFile() public
    Write a cached version of the file
  • _replaceSection() public

    Munges the output from a view with cache tags, and numbers the sections. This helps solve issues with empty/duplicate content.

  • _stripTags() public

    Strip cake:nocache tags from a string. Since View::render() only removes un-numbered nocache tags, remove all the numbered ones. This is the complement to _replaceSection.

  • cache() public
    Main method used to cache a view

Method Detail

__parseFile() public ¶

__parseFile( string $file , boolean $cache )

Parse file searching for no cache tags

Parameters
string $file
boolean $cache

__parseOutput() public ¶

__parseOutput( sting $cache )

Parse the output and replace cache tags

Parameters
sting $cache
Returns
string
with all replacements made to

__writeFile() public ¶

__writeFile( string $content , sting $timestamp , $useCallbacks = false )

Write a cached version of the file

Parameters
string $content
$file
sting $timestamp
$useCallbacks optional false
Returns
cached
view

_replaceSection() public ¶

_replaceSection( string $matches )

Munges the output from a view with cache tags, and numbers the sections. This helps solve issues with empty/duplicate content.

Parameters
string $matches
$content The content to munge.
Returns
string
The content with cake:nocache tags replaced.

_stripTags() public ¶

_stripTags( string $content )

Strip cake:nocache tags from a string. Since View::render() only removes un-numbered nocache tags, remove all the numbered ones. This is the complement to _replaceSection.

Parameters
string $content
String to remove tags from.
Returns
string
String with tags removed.

cache() public ¶

cache( string $file , string $out , boolean $cache = false )

Main method used to cache a view

Parameters
string $file
File to cache
string $out
output to cache
boolean $cache optional false
Returns
view
ouput

Properties detail

$__match ¶

public array

Array of string that are replace with there var replace above. The strings are any content inside and includes the tags in views

array()

$__replace ¶

public array

Array of strings replaced in cached views. The strings are found between in views

array()

$_counter ¶

public integer

Counter used for counting nocache section tags.

$cacheAction ¶

public object

cache action time

OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs