PHP y OOP
| From: | Matias Salimbene | Date: | Wed, 30 Mar 2005 22:25:12 +0000 |
| Subject: | PHP y OOP | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-53881@lists.php.net to get a copy of this message | ||
Holas, queria saber si se puede usar clases abstractas que contengan solo
variables. La idea es tener una base abstracta con un grupo de varibles que
despues se pasen a las subclases. Yo uso PHP Designer 5, y me tira un error
que dice que espera una funcion en lugar de una variable, en la linea donde
aparece la primera variable dentro de la clase abastracta. Por eso mi
consulta.
saludos!
EJEMPLO:
abstract class Core
{
//Core Attributes
$class; //The class of the element
$id; //A unique id for the element
$style; //An inline style definition
$title; //A text to display in a tool tip
//Language Attributes
$dir; //Sets the text direction
$lang; //Sets the language code
//Keyboard Attributes
$accesskey; //Sets a keyboard shortcut to access an element
$tabindex; //Sets the tab order of an element
}
class Table extends Core
{
//Optional Attributes
$align; //Aligns the table. Deprecated. Use styles instead. TF
$border; // pixels Specifies the border width.
$cellpadding; //Specifies the space between the cell walls and contents
STF
$cellspacing; //Specifies the space between cells STF
$frame; //Specifies how the outer borders should be displayed.
$rules; //Specifies the horizontal/vertical divider lines.
$summary; //Specifies a summary of the table for
speech-synthesizing/non-visual browsers
$width; //Specifies the width of the table STF
}