good morning
How can i include a class into my application?
good morning
How can i include a class into my application?
hi
make folder protected/classes
than call you class class_file_name.php
Yii::import("application.classes.class_file_name"); on top of controller file
Thanks
I just put classes in the models folder, worked no problems
<?php
class hfxImage {
public $title;
public $file;
public $alternate;
}
?>
then in controller
$towers = new hfxImage;
$towers->file = 'halifax/towers.jpg';
$towers->title = 'Halifax Harbour';
$towers->alternate ="Image of the harbour";
I’m sure that you could put it in components too.
doodle
thanks you for your help