CCodeFile
| Package | system.gii |
|---|---|
| Inheritance | class CCodeFile » CComponent |
| Since | 1.1.2 |
| Version | $Id: CCodeFile.php 2101 2010-05-06 20:27:16Z qiang.xue $ |
CCodeFile represents a code file being generated.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| content | mixed | the newly generated code. | CCodeFile |
| error | string | the error occurred when saving the code into a file | CCodeFile |
| operation | string | the operation to be performed | CCodeFile |
| path | string | the file path that the new code should be saved to. | CCodeFile |
| relativePath | string | the code file path relative to the application base path. | CCodeFile |
| type | string | the code file extension (e. | CCodeFile |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __call() | Calls the named method which is not a class method. | CComponent |
| __construct() | Constructor. | CCodeFile |
| __get() | Returns a property value, an event handler list or a behavior based on its name. | CComponent |
| __isset() | Checks if a property value is null. | CComponent |
| __set() | Sets value of a component property. | CComponent |
| __unset() | Sets a component property to be null. | CComponent |
| asa() | Returns the named behavior object. | CComponent |
| attachBehavior() | Attaches a behavior to this component. | CComponent |
| attachBehaviors() | Attaches a list of behaviors to the component. | CComponent |
| attachEventHandler() | Attaches an event handler to an event. | CComponent |
| canGetProperty() | Determines whether a property can be read. | CComponent |
| canSetProperty() | Determines whether a property can be set. | CComponent |
| detachBehavior() | Detaches a behavior from the component. | CComponent |
| detachBehaviors() | Detaches all behaviors from the component. | CComponent |
| detachEventHandler() | Detaches an existing event handler. | CComponent |
| disableBehavior() | Disables an attached behavior. | CComponent |
| disableBehaviors() | Disables all behaviors attached to this component. | CComponent |
| enableBehavior() | Enables an attached behavior. | CComponent |
| enableBehaviors() | Enables all behaviors attached to this component. | CComponent |
| evaluateExpression() | Evaluates a PHP expression or callback under the context of this component. | CComponent |
| getEventHandlers() | Returns the list of attached event handlers for an event. | CComponent |
| getRelativePath() | CCodeFile | |
| getType() | CCodeFile | |
| hasEvent() | Determines whether an event is defined. | CComponent |
| hasEventHandler() | Checks whether the named event has attached handlers. | CComponent |
| hasProperty() | Determines whether a property is defined. | CComponent |
| raiseEvent() | Raises an event. | CComponent |
| save() | Saves the code into the file path. | CCodeFile |
Property Details
content
property
public mixed $content;
the newly generated code. If this is null, it means path should be treated as a directory.
error
property
public string $error;
the error occurred when saving the code into a file
operation
property
public string $operation;
the operation to be performed
path
property
public string $path;
the file path that the new code should be saved to.
relativePath
property
read-only
public string getRelativePath()
the code file path relative to the application base path.
type
property
read-only
public string getType()
the code file extension (e.g. php, txt)
Method Details
__construct()
method
|
public void __construct(string $path, string $content)
| ||
| $path | string | the file path that the new code should be saved to. |
| $content | string | the newly generated code |
Constructor.
getRelativePath()
method
|
public string getRelativePath()
| ||
| {return} | string | the code file path relative to the application base path. |
getType()
method
|
public string getType()
| ||
| {return} | string | the code file extension (e.g. php, txt) |
save()
method
|
public void save()
|
Saves the code into the file path.