API16

Difference between revisions of "JCacheOutput/start"

From Joomla! Documentation

< API16:JCacheOutput
(New page: ===Description=== Start the cache <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> ...)
 
m (removing red link to edit, no existant pages)
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JCacheOutput/start|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JCacheOutput/start}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 56: Line 56:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JCacheOutput/start|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JCacheOutput/start}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 71: Line 71:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API16]]

Revision as of 21:53, 12 May 2013

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Start the cache

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax[edit]

start($id, $group=null)
Parameter Name Default Value Description
$id $id The cache data id
$group null $group The cache data group

Returns[edit]

boolean True if the cache is hit (false else)

Defined in[edit]

libraries/joomla/cache/handler/output.php

Importing[edit]

jimport( 'joomla.cache.handler.output' );

Source Body[edit]

function start($id, $group=null)
{
        // If we have data in cache use that...
        $data = $this->get($id, $group);
        if ($data !== false) {
                echo $data;
                return true;
        } else {
                // Nothing in cache... lets start the output buffer and start collecting data for next time.
                ob_start();
                ob_implicit_flush(false);
                // Set id and group placeholders
                $this->_id              = $id;
                $this->_group   = $group;
                return false;
        }
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples[edit]

<CodeExamplesForm />