View/Helper/TinySrc.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_View
- Subpackage
- Helper
\Zend_View_Helper_TinySrc
Package: Zend\View\HelperHelper for generating urls and/or image tags for use with tinysrc.net
tinysrc.net provides an API for generating scaled, browser device-specific
images. In essence, you pass the API the URL to an image on your own server,
and tinysrc.net then provides the appropriate image based on the device that
accesses it.
Additionally, tinysrc.net allows you to specify additional configuration via
the API:
- image size. You may define this as:
- explicit size
- subtractive size (size of screen minus specified number of pixels)
- percentage size (percentage of screen size))
- image format. This will convert the image to the given format; allowed
values are "png" or "jpeg". By default, gif images are converted to png.
This helper allows you to specify all configuration options, as well as:
- whether or not to generate the full image tag (or just the URL)
- base url to images (which should include the protocol, server, and
optionally port and base path)
- Parent(s)
- \Zend_View_Helper_HtmlElement
<
\Zend_View_Helper_Abstract
- See
- \global\http://tinysrc.net/
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants


TINYSRC_BASE
= 'http://i.tinysrc.mobi'
Properties



bool $_createTagFlag = true
Whether or not to create an image tag
Default valuetrue
Details- Type
- bool



string $_format = ''
Default image format to use
Default value''
Details- Type
- string
Methods



_htmlAttribs(array $attribs) : string
ParametersName | Type | Description |
---|
$attribs | array | From this array, each key-value pair is
converted to an attribute name and value.
|
---|
ReturnsType | Description |
---|
string | The XHTML for the attributes. |
Details- Access
- public



_mergeBaseUrl(array $options) : string
Determine whether to use default base URL, or base URL from options
ParametersName | Type | Description |
---|
$options | array | |
---|
Returns 


_mergeDimensions(array $options) : string
Determine whether to use default dimensions, or those passed in options.
ParametersName | Type | Description |
---|
$options | array | |
---|
Returns 


_mergeFormat(array $options) : string
Determine whether to use default format or format provided in options.
ParametersName | Type | Description |
---|
$options | array | |
---|
Returns 


setCreateTag(bool $flag) : \Zend_View_Helper_TinySrc
Set state of "create tag" flag
ParametersName | Type | Description |
---|
$flag | bool | |
---|
Returns 


tinySrc(mixed $image = null, array $options = array()) : void
Generate a link or image tag pointing to tinysrc.net
ParametersName | Type | Description |
---|
$image | mixed | |
---|
$options | array | |
---|