# 視圖助手(View Helpers)
# 視圖助手(View Helpers)
Writing and maintaining HTML markup can quickly become a tedious task because of the naming conventions and numerous attributes that have tobe taken into consideration. Phalcon deals with this complexity by offering [*Phalcon\\Tag*](#), which in turn offersview helpers to generate HTML markup.
This component can be used in a plain HTML+PHP view or in a [*Volt*](#) template.
> This guide is not intended to be a complete documentation of available helpers and their arguments. Please visitthe [*Phalcon\\Tag*](#) page in the API for a complete reference.
### 文檔類型(Document Type of Content)
Phalcon provides Phalcon\\Tag::setDoctype() helper to set document type of the content. Document type setting may affect HTML output produced by other tag helpers.For example, if you set XHTML document type family, helpers that return or output HTML tags will produce self-closing tags to follow valid XHTML standard.
Available document type constants in Phalcon\\Tag namespace are:
ConstantDocument typeHTML32HTML 3.2HTML401\_STRICTHTML 4.01 StrictHTML401\_TRANSITIONALHTML 4.01 TransitionalHTML401\_FRAMESETHTML 4.01 FramesetHTML5HTML 5XHTML10\_STRICTXHTML 1.0 StrictXHTML10\_TRANSITIONALXHTML 1.0 TransitionalXHTML10\_FRAMESETXHTML 1.0 FramesetXHTML11XHTML 1.1XHTML20XHTML 2.0XHTML5XHTML 5Setting document type.
```
<pre class="calibre14">```
<?php
use Phalcon\Tag;
$this->tag->setDoctype(Tag::HTML401_STRICT);
?>
```
```
Getting document type.
```
<pre class="calibre14">```
<?= $this->tag->getDoctype() ?>
<html>
<!-- your HTML code -->
</html>
```
```
The following HTML will be produced.
```
<pre class="calibre14">```
<html>
<!-- your HTML code -->
</html>
```
```
Volt syntax:
```
<pre class="calibre14">```
{{ get_doctype() }}
<html>
<!-- your HTML code -->
</html>
```
```
### 生成鏈接(Generating Links)
A real common task in any web application or website is to produce links that allow us to navigate from one page to another.When they are internal URLs we can create them in the following manner:
```
<pre class="calibre14">```
<!-- for the default route -->
<?= $this->tag->linkTo("products/search", "Search") ?>
<!-- with CSS attributes -->
<?= $this->tag->linkTo(array('products/edit/10', 'Edit', 'class' => 'edit-btn')) ?>
<!-- for a named route -->
<?= $this->tag->linkTo(array(array('for' => 'show-product', 'title' => 123, 'name' => 'carrots'), 'Show')) ?>
```
```
Actually, all produced URLs are generated by the component [*Phalcon\\Mvc\\Url*](#) (or service “url” failing)
Same links generated with Volt:
```
<pre class="calibre14">```
<!-- for the default route -->
{{ link_to("products/search", "Search") }}
<!-- for a named route -->
{{ link_to(['for': 'show-product', 'id': 123, 'name': 'carrots'], 'Show') }}
<!-- for a named route with a HTML class -->
{{ link_to(['for': 'show-product', 'id': 123, 'name': 'carrots'], 'Show', 'class': 'edit-btn') }}
```
```
### 創建表單(Creating Forms)
Forms in web applications play an essential part in retrieving user input. The following example shows how to implement a simple search form using view helpers:
```
<pre class="calibre14">```
<!-- Sending the form by method POST -->
<?= $this->tag->form("products/search") ?>
<label for="q">Search:</label>
<?= $this->tag->textField("q") ?>
<?= $this->tag->submitButton("Search") ?>
<?= $this->tag->endForm() ?>
<!-- Specifying another method or attributes for the FORM tag -->
<?= $this->tag->form(array("products/search", "method" => "get")); ?>
<label for="q">Search:</label>
<?= $this->tag->textField("q"); ?>
<?= $this->tag->submitButton("Search"); ?>
<?= $this->tag->endForm() ?>
```
```
This last code will generate the following HTML:
```
<pre class="calibre14">```
<form action="/store/products/search/" method="get">
<label for="q">Search:</label>
<input type="text" id="q" value="" name="q" />
<input type="submit" value="Search" />
</form>
```
```
Same form generated in Volt:
```
<pre class="calibre14">```
<!-- Specifying another method or attributes for the FORM tag -->
{{ form("products/search", "method": "get") }}
<label for="q">Search:</label>
{{ text_field("q") }}
{{ submit_button("Search") }}
{{ endForm() }}
```
```
Phalcon also provides a [*form builder*](#) to create forms in an object-oriented manner.
### 使用助手生成表單控件(Helpers to Generate Form Elements)
Phalcon provides a series of helpers to generate form elements such as text fields, buttons and more. The first parameter of each helper is always the name of the element to be generated. When the form is submitted, the name will be passed along with the form data. In a controller you can get these values using the same name by using the getPost() and getQuery() methods on the request object ($this->request).
```
<pre class="calibre14">```
<?php echo $this->tag->textField("username") ?>
<?php echo $this->tag->textArea(array(
"comment",
"This is the content of the text-area",
"cols" => "6",
"rows" => 20
)) ?>
<?php echo $this->tag->passwordField(array(
"password",
"size" => 30
)) ?>
<?php echo $this->tag->hiddenField(array(
"parent_id",
"value"=> "5"
)) ?>
```
```
Volt syntax:
```
<pre class="calibre14">```
{{ text_field("username") }}
{{ text_area("comment", "This is the content", "cols": "6", "rows": 20) }}
{{ password_field("password", "size": 30) }}
{{ hidden_field("parent_id", "value": "5") }}
```
```
### 使用選擇框(Making Select Boxes)
Generating select boxes (select box) is easy, especially if the related data is stored in PHP associative arrays. The helpers for select elements are Phalcon\\Tag::select() and Phalcon\\Tag::selectStatic().Phalcon\\Tag::select() has been was specifically designed to work with [*Phalcon\\Mvc\\Model*](#), while Phalcon\\Tag::selectStatic() can with PHP arrays.
```
<pre class="calibre14">```
<?php
// Using data from a resultset
echo $this->tag->select(
array(
"productId",
Products::find("type = 'vegetables'"),
"using" => array("id", "name")
)
);
// Using data from an array
echo $this->tag->selectStatic(
array(
"status",
array(
"A" => "Active",
"I" => "Inactive",
)
)
);
```
```
The following HTML will generated:
```
<pre class="calibre14">```
<select id="productId" name="productId">
<option value="101">Tomato</option>
<option value="102">Lettuce</option>
<option value="103">Beans</option>
</select>
<select id="status" name="status">
<option value="A">Active</option>
<option value="I">Inactive</option>
</select>
```
```
You can add an “empty” option to the generated HTML:
```
<pre class="calibre14">```
<?php
// Creating a Select Tag with an empty option
echo $this->tag->select(
array(
"productId",
Products::find("type = 'vegetables'"),
"using" => array("id", "name"),
"useEmpty" => true
)
);
```
```
Produces this HTML:
```
<pre class="calibre14">```
<select id="productId" name="productId">
<option value="">Choose..</option>
<option value="101">Tomato</option>
<option value="102">Lettuce</option>
<option value="103">Beans</option>
</select>
```
```
```
<pre class="calibre14">```
<?php
// Creating a Select Tag with an empty option with default text
echo $this->tag->select(
array(
'productId',
Products::find("type = 'vegetables'"),
'using' => array('id', "name"),
'useEmpty' => true,
'emptyText' => 'Please, choose one...',
'emptyValue' => '@'
)
);
```
```
```
<pre class="calibre14">```
<select id="productId" name="productId">
<option value="@">Please, choose one..</option>
<option value="101">Tomato</option>
<option value="102">Lettuce</option>
<option value="103">Beans</option>
</select>
```
```
Volt syntax for above example:
```
<pre class="calibre14">```
{# Creating a Select Tag with an empty option with default text #}
{{ select('productId', products, 'using': ['id', 'name'],
'useEmpty': true, 'emptyText': 'Please, choose one...', 'emptyValue': '@') }}
```
```
### 設置 HTML 屬性(Assigning HTML attributes)
All the helpers accept an array as their first parameter which can contain additional HTML attributes for the element generated.
```
<pre class="calibre14">```
<?php $this->tag->textField(
array(
"price",
"size" => 20,
"maxlength" => 30,
"placeholder" => "Enter a price"
)
) ?>
```
```
or using Volt:
```
<pre class="calibre14">```
{{ text_field("price", "size": 20, "maxlength": 30, "placeholder": "Enter a price") }}
```
```
The following HTML is generated:
```
<pre class="calibre14">```
<input type="text" name="price" id="price" size="20" maxlength="30"
placeholder="Enter a price" />
```
```
### 設置助手的值(Setting Helper Values)
### 通過控制器(From Controllers)
It is a good programming principle for MVC frameworks to set specific values for form elements in the view.You can set those values directly from the controller using Phalcon\\Tag::setDefault().This helper preloads a value for any helpers present in the view. If any helper in the view hasa name that matches the preloaded value, it will use it, unless a value is directly assigned on the helper in the view.
```
<pre class="calibre14">```
<?php
use Phalcon\Mvc\Controller;
class ProductsController extends Controller
{
public function indexAction()
{
$this->tag->setDefault("color", "Blue");
}
}
```
```
At the view, a selectStatic helper matches the same index used to preset the value. In this case “color”:
```
<pre class="calibre14">```
<?php
echo $this->tag->selectStatic(
array(
"color",
array(
"Yellow" => "Yellow",
"Blue" => "Blue",
"Red" => "Red"
)
)
);
```
```
This will generate the following select tag with the value “Blue” selected:
```
<pre class="calibre14">```
<select id="color" name="color">
<option value="Yellow">Yellow</option>
<option value="Blue" selected="selected">Blue</option>
<option value="Red">Red</option>
</select>
```
```
### 通過請求(From the Request)
A special feature that the [*Phalcon\\Tag*](#) helpers have is that they keep the valuesof form helpers between requests. This way you can easily show validation messages without losing entered data.
### 直接設置值(Specifying values directly)
Every form helper supports the parameter “value”. With it you can specify a value for the helper directly.When this parameter is present, any preset value using setDefault() or via request will be ignored.
### 動態設置文檔標題(Changing dynamically the Document Title)
[*Phalcon\\Tag*](#) offers helpers to change dynamically the document title from the controller.The following example demonstrates just that:
```
<pre class="calibre14">```
<?php
use Phalcon\Mvc\Controller;
class PostsController extends Controller
{
public function initialize()
{
$this->tag->setTitle("Your Website");
}
public function indexAction()
{
$this->tag->prependTitle("Index of Posts - ");
}
}
```
```
```
<pre class="calibre14">```
<html>
<head>
<?php echo $this->tag->getTitle(); ?>
</head>
<body>
</body>
</html>
```
```
The following HTML will generated:
```
<pre class="calibre14">```
<html>
<head>
<title>Index of Posts - Your Website</title>
</head>
<body>
</body>
</html>
```
```
### 靜態內容助手(Static Content Helpers)
[*Phalcon\\Tag*](#) also provide helpers to generate tags such as script, link or img. They aid in quick and easy generation of the static resources of your application
### 圖片(Images)
```
<pre class="calibre14">```
<?php
// Generate <img src="/your-app/img/hello.gif">
echo $this->tag->image("img/hello.gif");
// Generate <img alt="alternative text" src="/your-app/img/hello.gif">
echo $this->tag->image(
array(
"img/hello.gif",
"alt" => "alternative text"
)
);
```
```
Volt syntax:
```
<pre class="calibre14">```
{# Generate <img src="/your-app/img/hello.gif"> #}
{{ image("img/hello.gif") }}
{# Generate <img alt="alternative text" src="/your-app/img/hello.gif"> #}
{{ image("img/hello.gif", "alt": "alternative text") }}
```
```
### 樣式表(Stylesheets)
```
<pre class="calibre14">```
<?php
// Generate <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Rosario" type="text/css">
echo $this->tag->stylesheetLink("http://fonts.googleapis.com/css?family=Rosario", false);
// Generate <link rel="stylesheet" href="/your-app/css/styles.css" type="text/css">
echo $this->tag->stylesheetLink("css/styles.css");
```
```
Volt syntax:
```
<pre class="calibre14">```
{# Generate <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Rosario" type="text/css"> #}
{{ stylesheet_link("http://fonts.googleapis.com/css?family=Rosario", false) }}
{# Generate <link rel="stylesheet" href="/your-app/css/styles.css" type="text/css"> #}
{{ stylesheet_link("css/styles.css") }}
```
```
### 腳本(Javascript)
```
<pre class="calibre14">```
<?php
// Generate <script src="http://localhost/javascript/jquery.min.js" type="text/javascript"></script>
echo $this->tag->javascriptInclude("http://localhost/javascript/jquery.min.js", false);
// Generate <script src="/your-app/javascript/jquery.min.js" type="text/javascript"></script>
echo $this->tag->javascriptInclude("javascript/jquery.min.js");
```
```
Volt syntax:
```
<pre class="calibre14">```
{# Generate <script src="http://localhost/javascript/jquery.min.js" type="text/javascript"></script> #}
{{ javascript_include("http://localhost/javascript/jquery.min.js", false) }}
{# Generate <script src="/your-app/javascript/jquery.min.js" type="text/javascript"></script> #}
{{ javascript_include("javascript/jquery.min.js") }}
```
```
### HTML5 對象(HTML5 elements - generic HTML helper)
Phalcon offers a generic HTML helper that allows the generation of any kind of HTML element. It is up to the developer to produce a valid HTML element name to the helper.
```
<pre class="calibre14">```
<?php
// Generate
// <canvas id="canvas1" width="300" class="cnvclass">
// This is my canvas
// </canvas>
echo $this->tag->tagHtml("canvas", array("id" => "canvas1", "width" => "300", "class" => "cnvclass"), false, true, true);
echo "This is my canvas";
echo $this->tag->tagHtmlClose("canvas");
```
```
Volt syntax:
```
<pre class="calibre14">```
{# Generate
<canvas id="canvas1" width="300" class="cnvclass">
This is my canvas
</canvas> #}
{{ tag_html("canvas", ["id": "canvas1", width": "300", "class": "cnvclass"], false, true, true) }}
This is my canvas
{{ tag_html_close("canvas") }}
```
```
### 標簽服務(Tag Service)
[*Phalcon\\Tag*](#) is available via the ‘tag' service, this means you can access it from any partof the application where the services container is located:
```
<pre class="calibre14">```
<?php echo $this->tag->linkTo('pages/about', 'About') ?>
```
```
You can easily add new helpers to a custom component replacing the service ‘tag' in the services container:
```
<pre class="calibre14">```
<?php
use Phalcon\Tag;
class MyTags extends Tag
{
// ...
// Create a new helper
static public function myAmazingHelper($parameters)
{
// ...
}
// Override an existing method
static public function textField($parameters)
{
// ...
}
}
```
```
Then change the definition of the service ‘tag':
```
<pre class="calibre14">```
<?php
$di['tag'] = function () {
return new MyTags();
};
```
```
### 創建助手(Creating your own helpers)
You can easily create your own helpers. First, start by creating a new folder within the same directory as your controllers and models. Give it a title that is relative to what you are creating. For our example here, we can call it “customhelpers”. Next we will create a new file titled `MyTags.php` within this new directory. At this point, we have a structure that looks similar to : `/app/customhelpers/MyTags.php`. In `MyTags.php`, we will extend the [*Phalcon\\Tag*](#) and implement your own helper. Below is a simple example of a custom helper:
```
<pre class="calibre14">```
<?php
use Phalcon\Tag;
class MyTags extends Tag
{
/**
* Generates a widget to show a HTML5 audio tag
*
* @param array
* @return string
*/
static public function audioField($parameters)
{
// Converting parameters to array if it is not
if (!is_array($parameters)) {
$parameters = array($parameters);
}
// Determining attributes "id" and "name"
if (!isset($parameters[0])) {
$parameters[0] = $parameters["id"];
}
$id = $parameters[0];
if (!isset($parameters["name"])) {
$parameters["name"] = $id;
} else {
if (!$parameters["name"]) {
$parameters["name"] = $id;
}
}
// Determining widget value,
// \Phalcon\Tag::setDefault() allows to set the widget value
if (isset($parameters["value"])) {
$value = $parameters["value"];
unset($parameters["value"]);
} else {
$value = self::getValue($id);
}
// Generate the tag code
$code = '<audio id="'.$id.'" value="'.$value.'" ';
foreach ($parameters as $key => $attributeValue) {
if (!is_integer($key)) {
$code.= $key.'="'.$attributeValue.'" ';
}
}
$code.=" />";
return $code;
}
}
```
```
After creating our custom helper, we will autoload the new directory that contains our helper class from our “index.php” located in the public directory.
```
<pre class="calibre14">```
<?php
use Phalcon\Loader;
use Phalcon\Mvc\Application;
use Phalcon\DI\FactoryDefault();
use Phalcon\Exception as PhalconException;
try {
$loader = new Loader();
$loader->registerDirs(array(
'../app/controllers',
'../app/models',
'../app/customhelpers' // Add the new helpers folder
))->register();
$di = new FactoryDefault();
// Assign our new tag a definition so we can call it
$di->set('MyTags', function () {
return new MyTags();
});
$application = new Application($di);
echo $application->handle()->getContent();
} catch (PhalconException $e) {
echo "PhalconException: ", $e->getMessage();
}
```
```
Now you are ready to use your new helper within your views:
```
<pre class="calibre14">```
<body>
<?php
echo MyTags::audioField(
array(
'name' => 'test',
'id' => 'audio_test',
'src' => '/path/to/audio.mp3'
)
);
?>
</body>
```
```
In next chapter, we'll talk about [*Volt*](#) a faster template engine for PHP, where you can use amore friendly syntax for using helpers provided by Phalcon\\Tag.
|
- [索引](# "總目錄")
- [下一頁](# "資源文件管理(Assets Management)") |
- [上一頁](# "使用視圖(Using Views)") |
- API參考
- API列表
- Abstract class Phalcon\Acl
- Abstract class Phalcon\Acl\Adapter
- Class Phalcon\Acl\Adapter\Memory
- Interface Phalcon\Acl\AdapterInterface
- Class Phalcon\Acl\Exception
- Class Phalcon\Acl\Resource
- Interface Phalcon\Acl\ResourceInterface
- Class Phalcon\Acl\Role
- Interface Phalcon\Acl\RoleInterface
- Class Phalcon\Annotations\Annotation
- Abstract class Phalcon\Annotations\Adapter
- Interface Phalcon\Annotations\AdapterInterface
- Class Phalcon\Annotations\Collection
- Class Phalcon\Annotations\Exception
- Class Phalcon\Annotations\Reader
- Interface Phalcon\Annotations\ReaderInterface
- Class Phalcon\Annotations\Reflection
- Class Phalcon\Assets\Collection
- Class Phalcon\Assets\Exception
- Interface Phalcon\Assets\FilterInterface
- Class Phalcon\Assets\Filters\Cssmin
- Class Phalcon\Assets\Filters\Jsmin
- Class Phalcon\Assets\Filters\None
- Class Phalcon\Assets\Inline
- Class Phalcon\Assets\Inline\Css
- Class Phalcon\Assets\Inline\Js
- Class Phalcon\Assets\Manager
- Class Phalcon\Assets\Resource
- Class Phalcon\Assets\Resource\Css
- Class Phalcon\Assets\Resource\Js
- Abstract class Phalcon\Cache\Backend
- Class Phalcon\Cache\Backend\Apc
- Class Phalcon\Cache\Backend\File
- Class Phalcon\Cache\Backend\Libmemcached
- Class Phalcon\Cache\Backend\Memcache
- Class Phalcon\Cache\Backend\Memory
- Class Phalcon\Cache\Backend\Mongo
- Class Phalcon\Cache\Backend\Redis
- Class Phalcon\Cache\Backend\Xcache
- Interface Phalcon\Cache\BackendInterface
- Class Phalcon\Cache\Exception
- Class Phalcon\Cache\Frontend\Base64
- Class Phalcon\Cache\Frontend\Data
- Class Phalcon\Cache\Frontend\Igbinary
- Class Phalcon\Cache\Frontend\Json
- Class Phalcon\Cache\Frontend\None
- Class Phalcon\Cache\Frontend\Output
- Interface Phalcon\Cache\FrontendInterface
- Class Phalcon\Cache\Multiple
- Class Phalcon\Cli\Router\Route
- Class Phalcon\Config
- Class Phalcon\Config\Adapter\Ini
- Class Phalcon\Config\Adapter\Json
- Class Phalcon\Config\Adapter\Php
- Class Phalcon\Config\Adapter\Yaml
- Class Phalcon\Config\Exception
- Class Phalcon\Crypt
- Class Phalcon\Crypt\Exception
- Interface Phalcon\CryptInterface
- Abstract class Phalcon\Db
- Abstract class Phalcon\Db\Adapter
- Interface Phalcon\Db\AdapterInterface
- Class Phalcon\Db\Column
- Interface Phalcon\Db\ColumnInterface
- Abstract class Phalcon\Db\Dialect
- Interface Phalcon\Db\DialectInterface
- Class Phalcon\Db\Exception
- Class Phalcon\Db\Index
- Interface Phalcon\Db\IndexInterface
- Class Phalcon\Db\Profiler
- Class Phalcon\Db\RawValue
- Class Phalcon\Db\Reference
- Interface Phalcon\Db\ReferenceInterface
- Class Phalcon\Db\Result\Pdo
- Interface Phalcon\Db\ResultInterface
- Class Phalcon\Debug
- Class Phalcon\Debug\Dump
- Class Phalcon\Debug\Exception
- Interface Phalcon\DiInterface
- Abstract class Phalcon\Dispatcher
- Interface Phalcon\DispatcherInterface
- Class Phalcon\Escaper
- Class Phalcon\Escaper\Exception
- Interface Phalcon\EscaperInterface
- Class Phalcon\Events\Event
- Interface Phalcon\Events\EventsAwareInterface
- Class Phalcon\Events\Exception
- Class Phalcon\Events\Manager
- Interface Phalcon\Events\ManagerInterface
- Class Phalcon\Exception
- Class Phalcon\Filter
- Class Phalcon\Filter\Exception
- Interface Phalcon\Filter\UserFilterInterface
- Interface Phalcon\FilterInterface
- Abstract class Phalcon\Flash
- Class Phalcon\Flash\Direct
- Class Phalcon\Flash\Exception
- Class Phalcon\Flash\Session
- Interface Phalcon\FlashInterface
- Class Phalcon\Forms\Form
- Abstract class Phalcon\Forms\Element
- Class Phalcon\Forms\Exception
- Class Phalcon\Forms\Manager
- Class Phalcon\Http\Cookie
- Class Phalcon\Http\Cookie\Exception
- Class Phalcon\Http\Request
- Class Phalcon\Http\Request\Exception
- Class Phalcon\Http\Request\File
- Interface Phalcon\Http\Request\FileInterface
- Interface Phalcon\Http\RequestInterface
- Class Phalcon\Http\Response
- Class Phalcon\Http\Response\Cookies
- Interface Phalcon\Http\Response\CookiesInterface
- Class Phalcon\Http\Response\Exception
- Class Phalcon\Http\Response\Headers
- Interface Phalcon\Http\Response\HeadersInterface
- Interface Phalcon\Http\ResponseInterface
- Class Phalcon\Image
- Abstract class Phalcon\Image\Adapter
- Class Phalcon\Image\Adapter\Imagick
- Interface Phalcon\Image\AdapterInterface
- Class Phalcon\Image\Exception
- Class Phalcon\Kernel
- Class Phalcon\Loader
- Class Phalcon\Loader\Exception
- Abstract class Phalcon\Logger
- Abstract class Phalcon\Logger\Adapter
- Class Phalcon\Logger\Adapter\File
- Class Phalcon\Logger\Adapter\Firephp
- Class Phalcon\Logger\Adapter\Stream
- Class Phalcon\Logger\Adapter\Syslog
- Interface Phalcon\Logger\AdapterInterface
- Class Phalcon\Logger\Exception
- Abstract class Phalcon\Logger\Formatter
- Interface Phalcon\Logger\FormatterInterface
- Class Phalcon\Logger\Item
- Class Phalcon\Logger\Multiple
- Class Phalcon\Mvc\Application
- Class Phalcon\Mvc\Application\Exception
- Abstract class Phalcon\Mvc\Collection
- Abstract class Phalcon\Mvc\Collection\Behavior
- Class Phalcon\Mvc\Collection\Behavior\SoftDelete
- Class Phalcon\Mvc\Collection\Behavior\Timestampable
- Interface Phalcon\Mvc\Collection\BehaviorInterface
- Class Phalcon\Mvc\Collection\Document
- Class Phalcon\Mvc\Collection\Exception
- Class Phalcon\Mvc\Collection\Manager
- Interface Phalcon\Mvc\Collection\ManagerInterface
- Interface Phalcon\Mvc\CollectionInterface
- Abstract class Phalcon\Mvc\Controller
- Interface Phalcon\Mvc\ControllerInterface
- Class Phalcon\Mvc\Dispatcher
- Class Phalcon\Mvc\Dispatcher\Exception
- Interface Phalcon\Mvc\DispatcherInterface
- Interface Phalcon\Mvc\EntityInterface
- Class Phalcon\Mvc\Micro
- Class Phalcon\Mvc\Micro\Collection
- Interface Phalcon\Mvc\Micro\CollectionInterface
- Class Phalcon\Mvc\Micro\Exception
- Class Phalcon\Mvc\Micro\LazyLoader
- Interface Phalcon\Mvc\Micro\MiddlewareInterface
- Abstract class Phalcon\Mvc\Model
- Abstract class Phalcon\Mvc\Model\Behavior
- Class Phalcon\Mvc\Model\Criteria
- Interface Phalcon\Mvc\Model\CriteriaInterface
- Class Phalcon\Mvc\Model\Exception
- Class Phalcon\Mvc\Model\Manager
- Interface Phalcon\Mvc\Model\ManagerInterface
- Class Phalcon\Mvc\Model\Message
- Interface Phalcon\Mvc\Model\MessageInterface
- Abstract class Phalcon\Mvc\Model\MetaData
- Interface Phalcon\Mvc\Model\MetaDataInterface
- Class Phalcon\Mvc\Model\Query
- Interface Phalcon\Mvc\Model\QueryInterface
- Class Phalcon\Mvc\Model\Relation
- Interface Phalcon\Mvc\Model\RelationInterface
- Interface Phalcon\Mvc\Model\ResultInterface
- Abstract class Phalcon\Mvc\Model\Resultset
- Abstract class Phalcon\Mvc\Model\Validator
- Interface Phalcon\Mvc\Model\ResultsetInterface
- Class Phalcon\Mvc\Model\Row
- Class Phalcon\Mvc\Model\Transaction
- Interface Phalcon\Mvc\Model\TransactionInterface
- Class Phalcon\Mvc\Model\ValidationFailed
- Interface Phalcon\Mvc\ModelInterface
- Interface Phalcon\Mvc\ModuleDefinitionInterface
- Class Phalcon\Mvc\Router
- Class Phalcon\Mvc\Router\Annotations
- Class Phalcon\Mvc\Router\Exception
- Class Phalcon\Mvc\Router\Group
- Interface Phalcon\Mvc\Router\GroupInterface
- Class Phalcon\Mvc\Router\Route
- Interface Phalcon\Mvc\Router\RouteInterface
- Interface Phalcon\Mvc\RouterInterface
- Class Phalcon\Mvc\Url
- Class Phalcon\Mvc\Url\Exception
- Interface Phalcon\Mvc\UrlInterface
- Class Phalcon\Mvc\User\Component
- Class Phalcon\Mvc\User\Module
- Class Phalcon\Mvc\User\Plugin
- Class Phalcon\Mvc\View
- Abstract class Phalcon\Mvc\View\Engine
- Interface Phalcon\Mvc\View\EngineInterface
- Class Phalcon\Mvc\View\Exception
- Class Phalcon\Mvc\View\Simple
- Interface Phalcon\Mvc\ViewBaseInterface
- Interface Phalcon\Mvc\ViewInterface
- Abstract class Phalcon\Paginator\Adapter
- Class Phalcon\Paginator\Adapter\Model
- Class Phalcon\Paginator\Adapter\NativeArray
- Class Phalcon\Paginator\Adapter\QueryBuilder
- Interface Phalcon\Paginator\AdapterInterface
- Class Phalcon\Paginator\Exception
- Class Phalcon\Queue\Beanstalk
- Class Phalcon\Queue\Beanstalk\Job
- Final class Phalcon\Registry
- Class Phalcon\Security
- Class Phalcon\Security\Exception
- Abstract class Phalcon\Session
- Abstract class Phalcon\Session\Adapter
- Interface Phalcon\Session\AdapterInterface
- Class Phalcon\Session\Bag
- Interface Phalcon\Session\BagInterface
- Class Phalcon\Session\Exception
- Class Phalcon\Tag
- Class Phalcon\Tag\Exception
- Abstract class Phalcon\Tag\Select
- Abstract class Phalcon\Text
- Abstract class Phalcon\Translate
- Abstract class Phalcon\Translate\Adapter
- Class Phalcon\Translate\Adapter\Csv
- Class Phalcon\Translate\Adapter\Gettext
- Class Phalcon\Translate\Adapter\NativeArray
- Interface Phalcon\Translate\AdapterInterface
- Class Phalcon\Translate\Exception
- Class Phalcon\Validation
- Class Phalcon\Validation\Exception
- Class Phalcon\Validation\Message
- Class Phalcon\Validation\Message\Group
- Interface Phalcon\Validation\MessageInterface
- Abstract class Phalcon\Validation\Validator
- Class Phalcon\Validation\Validator\Alnum
- Class Phalcon\Validation\Validator\Alpha
- Class Phalcon\Validation\Validator\Between
- Class Phalcon\Validation\Validator\Confirmation
- Class Phalcon\Validation\Validator\Digit
- Class Phalcon\Validation\Validator\Email
- Class Phalcon\Validation\Validator\ExclusionIn
- Class Phalcon\Validation\Validator\File
- Class Phalcon\Validation\Validator\Identical
- Class Phalcon\Validation\Validator\InclusionIn
- Class Phalcon\Validation\Validator\Numericality
- Class Phalcon\Validation\Validator\PresenceOf
- Class Phalcon\Validation\Validator\Regex
- Class Phalcon\Validation\Validator\StringLength
- Class Phalcon\Validation\Validator\Uniqueness
- Class Phalcon\Validation\Validator\Url
- Interface Phalcon\Validation\ValidatorInterface
- Class Phalcon\Version
- 參考手冊
- 安裝(Installation)
- 教程 1:讓我們通過例子來學習(Tutorial 1: Let’s learn by example)
- 教程 2:Introducing INVO(Tutorial 2: Introducing INVO)
- 教程 3: Securing INVO
- 教程 4: Using CRUDs
- 教程 5: Customizing INVO
- 教程 6: Vkuró
- 教程 7:創建簡單的 REST API(Tutorial 7: Creating a Simple REST API)
- 示例列表(List of examples)
- 依賴注入與服務定位器(Dependency Injection/Service Location)
- MVC 架構(The MVC Architecture)
- 使用控制器(Using Controllers)
- 使用模型(Working with Models)
- 模型元數據(Models Meta-Data)
- 事務管理(Model Transactions)
- Phalcon 查詢語言(Phalcon Query Language (PHQL))
- 緩存對象關系映射(Caching in the ORM)
- 對象文檔映射 ODM (Object-Document Mapper)
- 使用視圖(Using Views)
- 視圖助手(View Helpers)
- 資源文件管理(Assets Management)
- Volt 模版引擎(Volt: Template Engine)
- MVC 應用(MVC Applications)
- 路由(Routing)
- 調度控制器(Dispatching Controllers)
- 微應用(Micro Applications)
- 使用命名空間(Working with Namespaces)
- 事件管理器(Events Manager)
- Request Environment
- 返回響應(Returning Responses)
- Cookie 管理(Cookies Management)
- 生成 URL 和 路徑(Generating URLs and Paths)
- 閃存消息(Flashing Messages)
- 使用 Session 存儲數據(Storing data in Session)
- 過濾與清理(Filtering and Sanitizing)
- 上下文編碼(Contextual Escaping)
- 驗證(Validation)
- 表單(Forms)
- 讀取配置(Reading Configurations)
- 分頁(Pagination)
- 使用緩存提高性能(Improving Performance with Cache)
- 安全(Security)
- Encryption/Decryption
- 訪問控制列表 ACL(Access Control Lists ACL)
- 多語言支持(Multi-lingual Support)
- Universal Class Loader
- 日志記錄(Logging)
- 注釋解析器(Annotations Parser)
- 命令行應用(Command Line Applications)
- 隊列(Queueing)
- 數據庫抽象層(Database Abstraction Layer)
- 國際化(Internationalization)
- 數據庫遷移(Database Migrations)
- 調試應用程序(Debugging Applications)
- Phalcon 開發工具(Phalcon Developer Tools)
- 提高性能:下一步該做什么?(Increasing Performance: What’s next?)
- 單元測試(Unit testing)
- 授權(License)