PHP Classes
Icontem

File: QueryTemplatesSourceQuery.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tobiasz Cudnik  >  Query Templates  >  QueryTemplatesSourceQuery.php  
File: QueryTemplatesSourceQuery.php
Role: Class source
Content type: text/plain
Description: QueryTemplatesSourceQuery.php
Class: Query Templates
Template engine using load, traverse and modify
 

Contents

Class file image Download
<?php
/**
 * Class handling template source fetching.
 * 
 * @package QueryTemplates
 * @author Tobiasz Cudnik <tobiasz.cudnik/gmail.com>
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
 * @link http://code.google.com/p/querytemplates/
 */
class QueryTemplatesSourceQuery
    
extends QueryTemplatesPhpQuery
    implements IQueryTemplatesTemplateChain
,
        
IQueryTemplatesTemplateSources,
        
IQueryTemplatesTemplateParse {
    
/**
     * Enter description here...
     *
     * @var QueryTemplatesTemplate
     */
    
public $parent;
    
public function __construct($parent$src) {
        if ( 
$parent instanceof self ) {
            
// new instance call from phpQuery
            // link all important vars to new object
            
$this->parent =& $parent->parent;
            
$docId $src;
        } else {
            
$this->parent $parent;
            
$docId phpQuery::newDocument($src)->getDocumentId();
        }
        
parent::__construct($docId);
    }
    
/**
     * Enter description here...
     *
     * @param unknown_type $name
     * @return QueryTemplatesSourceQuery
     */
    
public function collect($name) {
        
$this->parent->collected[$name] = $this->markupOuter();
        return 
$this;
    }
    
/**
     * Enter description here...
     *
     * @return QueryTemplatesTemplate
     */
    
public function sourceEnd() {
        
$this->unloadDocument();
        return 
$this->parent;
    }
    
/**
     * Start template parsing stage.
     *
     * @return string|QueryTemplatesParse
     * @see QueryTemplates::parse()
     */
    
public function parse() {
        
$this->fetchEnd();
        return 
$this->parent->parse();
    }
    
/**
     * @see QueryTemplatesTemplate::templateCache()
     * @return QueryTemplatesSourceQuery
     */
    
public function templateCache($state null) {
        
$this->parent->templateCache($state);
        return 
$this;
    }
    
/**
     * @see QueryTemplatesTemplate::templateName()
     * @return QueryTemplatesSourceQuery
     */
    
public function templateName($newName null) {
        
$this->parent->templateName($state);
        return 
$this;
    }
    
/**
     * Fetch file or URL.
     *
     * @param string $path
     * @param string $name
     * @return QueryTemplatesTemplate
     * @see QueryTemplates::fetch()
     */
    
public function sourceCollect($path$name null) {
        
$this->sourceEnd();
        
$args func_get_args();
        return 
call_user_method_array('sourceCollect'$this->parent$args);
    }
    
/**
     * @param string $path
     * @return QueryTemplatesTemplate
     * @see QueryTemplatesTemplate::sourceQuery()
     */
    
public function sourceCollectPHP($path$name null) {
        
$this->sourceEnd();
        
$args func_get_args();
        return 
call_user_method_array('sourceCollectPHP'$this->parent$args);
    }
    
/**
     * Fetch file or URL and return phpQuery object with collect() method to
     * fetch speficic part(s) of template.
     *
     * @param string $path
     * @return QueryTemplatesSourceQuery
     * @see QueryTemplatesTemplate::sourceQuery()
     */
    
public function sourceQuery($path) {
        
$this->sourceEnd();
        
$args func_get_args();
        return 
call_user_method_array('sourceQuery'$this->parent$args);
    }
    
/**
     * @param string $path
     * @return QueryTemplatesSourceQuery
     * @see QueryTemplatesTemplate::sourceQuery()
     */
    
public function sourceQueryPHP($path$name null) {
        
$this->sourceEnd();
        
$args func_get_args();
        return 
call_user_method_array('sourceQueryPHP'$this->parent$args);
    }
}

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products