Nos\
Orm_Behaviour_Virtualpath
¶Nos\Orm_Behaviour_Virtualname
.See also
Nos\Orm_Behaviour_Virtualname
for configuration and methods.
Nos\Orm_Behaviour_Virtualpath::$
virtual_path_property
¶Required. Column name use for save virtual path.
Nos\Orm_Behaviour_Virtualpath::$
extension_property
¶Required.
If it’s a string
, it will be appended to the virtual path.
If it’s an array
:
before: String to add to extension start. after: String to add to extension end. property: Column name used to store the extension.
Nos\Orm_Behaviour_Virtualpath::$
extension_property
Required. Name of the parent relation use to generate the first part of the virtual path.
Nos\Orm_Behaviour_Virtualpath::
virtual_path
($dir = false)¶Parameters: |
|
---|---|
Returns: | Virtual path of the item. |
Nos\Orm_Behaviour_Virtualpath::
extension
()¶Returns: | Return extension part of the virtual path. |
---|
<?php
class Model_Page extends \Nos\Orm\Model
{
protected static $_behaviours = array(
'Nos\Orm_Behaviour_Virtualpath' => array(
'events' => array('before_save', 'after_save', 'change_parent'),
'virtual_name_property' => 'page_virtual_name',
'virtual_path_property' => 'page_virtual_url',
'extension_property' => '.html',
'parent_relation' => 'parent',
),
);
}