model/modx/import/modstaticimport.class.php
- package
- modx
- subpackage
- import
- Classes
- modStaticImport
Description
\modStaticImport
- Extends from
- \modImport
- package
- modx
- subpackage
- import
- Methods
- getResourceAlias
- importFiles
Description
Provides common functions for importing content from static files.
Methods
getResourceAlias
getResourceAlias(
\modResource $resource, string $alias, integer $parent, string $context
=
web
)
:
string
Calculate a resource alias from the imported file
Arguments
- $resource
- \modResource
A reference to the new modResource object - $alias
- string
A suggested alias - $parent
- integer
The parent ID of the Resource - $context
- string
The context of the Resource
Output
- string
- The formatted alias
Details
- visibility
- public
- final
- false
- static
- false
importFiles
importFiles(
array $allowedfiles, integer $parent, string $filepath, array $files, string $context
=
web, string $class
=
modStaticResource, string $basefilepath
)
:
Import files into MODX
Arguments
- $allowedfiles
- array
An array of allowed file types - $parent
- integer
The parent Resource to pull into - $filepath
- string
The path to the files to import - $files
- array
An array of imported files - $context
- string
The context to import into - $class
- string
The class of Resource to import as - $basefilepath
- string
The base file path for the import
Details
- visibility
- public
- final
- false
- static
- false