mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 18:24:57 +02:00
Initial commit to new repo (carried over from: https://github.com/ryancramerdesign/ProcessWire/tree/devns)
This commit is contained in:
31
wire/core/TemplatesArray.php
Normal file
31
wire/core/TemplatesArray.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php namespace ProcessWire;
|
||||
|
||||
/**
|
||||
* ProcessWire Templates
|
||||
*
|
||||
* WireArray of Template instances as used by Templates class.
|
||||
*
|
||||
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
|
||||
* https://processwire.com
|
||||
*
|
||||
*/
|
||||
|
||||
class TemplatesArray extends WireArray {
|
||||
|
||||
public function isValidItem($item) {
|
||||
return $item instanceof Template;
|
||||
}
|
||||
|
||||
public function isValidKey($key) {
|
||||
return is_int($key) || ctype_digit($key);
|
||||
}
|
||||
|
||||
public function getItemKey($item) {
|
||||
return $item->id;
|
||||
}
|
||||
|
||||
public function makeBlankItem() {
|
||||
return $this->wire(new Template());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user