PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- class HtmlPage {
- private $title;
- public function __construct($title, $keywords, $cssref = null){
- //if($keywords != null){
- // $this->keywords = array_values($keywords);
- //}
- //
- //if($cssref != null){
- // $this->cssref = array_values($cssref);
- //}
- if(!$this->setTitle($title)){
- $this->title=null;
- }
- }
- public function addKeywords($keywords){
- }
- public function addCssref($cssref){
- }
- public function setTitle($title){
- $this->title = $title;
- return true;
- }
- }
- return false;
- }
- public function getKeywords(){
- return $this->keywords;
- }
- public function getCssref(){
- return $this->cssref;
- }
- public function getTitle(){
- return $this->title;
- }
- public function __toString(){
- $str = 'title: '.$this->title.'</br>'
- . 'array: ';
- foreach ($this->cssref as $key){
- $str .= $key.'</br>';
- }
- return $str;
- }
- }
- $var = new HtmlPage('тайтлтест', $arr_key, $arr_css);
- echo $var;