Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Define and operate over one Worksheet. More...
Public Member Functions | |
__construct ($name, Spreadsheet $workbook) | |
Constructs one Moodle Worksheet. | |
hide_gridlines () | |
Set the option to hide grid lines on the printed page. | |
hide_screen_gridlines () | |
Set the option to hide gridlines on the worksheet (as seen on the screen). | |
insert_bitmap ($row, $col, $bitmap, $x=0, $y=0, $scalex=1, $scaley=1) | |
Insert an image in a worksheet. | |
merge_cells ($firstrow, $firstcol, $lastrow, $lastcol) | |
Merges the area given by its arguments. | |
set_column ($firstcol, $lastcol, $width, $format=null, $hidden=false, $level=0) | |
Sets the width (and other settings) of one column. | |
set_row ($row, $height, $format=null, $hidden=false, $level=0) | |
Sets the height (and other settings) of one row. | |
write ($row, $col, $token, $format=null) | |
Write anything somewhere in the worksheet, type will be automatically detected. | |
write_blank ($row, $col, $format=null) | |
Write one blank somewhere in the worksheet. | |
write_date ($row, $col, $date, $format=null) | |
Write one date somewhere in the worksheet. | |
write_formula ($row, $col, $formula, $format=null) | |
Write one formula somewhere in the worksheet. | |
write_number ($row, $col, $num, $format=null) | |
Write one number somewhere in the worksheet. | |
write_string ($row, $col, $str, $format=null) | |
Write one string somewhere in the worksheet. | |
write_url ($row, $col, $url, $format=null) | |
Write one url somewhere in the worksheet. | |
Protected Member Functions | |
apply_column_format ($col, $format=null) | |
apply_format ($row, $col, $format=null) | |
apply_row_format ($row, $format=null) | |
Protected Attributes | |
Worksheet | $worksheet |
Define and operate over one Worksheet.
This class acts as a wrapper around another library maintaining Moodle functions isolated from underlying code.
MoodleExcelWorksheet::__construct | ( | $name, | |
Spreadsheet | $workbook ) |
Constructs one Moodle Worksheet.
string | $name | The name of the file |
Spreadsheet | $workbook | The internal Workbook object we are creating. |
MoodleExcelWorksheet::insert_bitmap | ( | $row, | |
$col, | |||
$bitmap, | |||
$x = 0, | |||
$y = 0, | |||
$scalex = 1, | |||
$scaley = 1 ) |
Insert an image in a worksheet.
integer | $row | The row we are going to insert the bitmap into |
integer | $col | The column we are going to insert the bitmap into |
string | $bitmap | The bitmap filename |
integer | $x | The horizontal position (offset) of the image inside the cell. |
integer | $y | The vertical position (offset) of the image inside the cell. |
integer | $scalex | The horizontal scale |
integer | $scaley | The vertical scale |
MoodleExcelWorksheet::merge_cells | ( | $firstrow, | |
$firstcol, | |||
$lastrow, | |||
$lastcol ) |
Merges the area given by its arguments.
integer | $firstrow | First row of the area to merge |
integer | $firstcol | First column of the area to merge |
integer | $lastrow | Last row of the area to merge |
integer | $lastcol | Last column of the area to merge |
MoodleExcelWorksheet::set_column | ( | $firstcol, | |
$lastcol, | |||
$width, | |||
$format = null, | |||
$hidden = false, | |||
$level = 0 ) |
Sets the width (and other settings) of one column.
integer | $firstcol | first column on the range |
integer | $lastcol | last column on the range |
integer | $width | width to set (null to set just format without setting the width) |
mixed | $format | The optional format to apply to the columns |
bool | $hidden | The optional hidden attribute |
integer | $level | The optional outline level (0-7) |
MoodleExcelWorksheet::set_row | ( | $row, | |
$height, | |||
$format = null, | |||
$hidden = false, | |||
$level = 0 ) |
Sets the height (and other settings) of one row.
integer | $row | The row to set |
integer | $height | Height we are giving to the row (null to set just format without setting the height) |
mixed | $format | The optional format we are giving to the row |
bool | $hidden | The optional hidden attribute |
integer | $level | The optional outline level (0-7) |
MoodleExcelWorksheet::write | ( | $row, | |
$col, | |||
$token, | |||
$format = null ) |
Write anything somewhere in the worksheet, type will be automatically detected.
integer | $row | Zero indexed row |
integer | $col | Zero indexed column |
mixed | $token | What we are writing |
mixed | $format | The XF format for the cell |
MoodleExcelWorksheet::write_blank | ( | $row, | |
$col, | |||
$format = null ) |
Write one blank somewhere in the worksheet.
integer | $row | Zero indexed row |
integer | $col | Zero indexed column |
mixed | $format | The XF format for the cell |
MoodleExcelWorksheet::write_date | ( | $row, | |
$col, | |||
$date, | |||
$format = null ) |
Write one date somewhere in the worksheet.
integer | $row | Zero indexed row |
integer | $col | Zero indexed column |
int | $date | The date to write in UNIX timestamp format |
mixed | $format | The XF format for the cell |
MoodleExcelWorksheet::write_formula | ( | $row, | |
$col, | |||
$formula, | |||
$format = null ) |
Write one formula somewhere in the worksheet.
integer | $row | Zero indexed row |
integer | $col | Zero indexed column |
string | $formula | The formula to write |
mixed | $format | The XF format for the cell |
MoodleExcelWorksheet::write_number | ( | $row, | |
$col, | |||
$num, | |||
$format = null ) |
Write one number somewhere in the worksheet.
integer | $row | Zero indexed row |
integer | $col | Zero indexed column |
float | $num | The number to write |
mixed | $format | The XF format for the cell |
MoodleExcelWorksheet::write_string | ( | $row, | |
$col, | |||
$str, | |||
$format = null ) |
Write one string somewhere in the worksheet.
integer | $row | Zero indexed row |
integer | $col | Zero indexed column |
string | $str | The string to write |
mixed | $format | The XF format for the cell |
MoodleExcelWorksheet::write_url | ( | $row, | |
$col, | |||
$url, | |||
$format = null ) |
Write one url somewhere in the worksheet.
integer | $row | Zero indexed row |
integer | $col | Zero indexed column |
string | $url | The url to write |
mixed | $format | The XF format for the cell |