English 中文(简体)
完全面向目标 PHP 方案拟定样本
原标题:Fully-Object-oriented PHP programming sample
  • 时间:2011-11-04 00:10:40
  •  标签:
  • php
  • oop

是否有一个小型的全面业务协调办公室网站样本? 我看到Joomla! 守则和我喜欢,但我花了多少时间来理解整个法典。 我很想知道是否有一个简单的样本。 我通过全面制定业务协调办公室方案向你们表明我所说的话,这里是Joomla! s. 行政页码:

<?php

define( _JEXEC , 1);
define( DS , DIRECTORY_SEPARATOR);

if (file_exists(dirname(__FILE__) .  /defines.php )) {
    include_once dirname(__FILE__) .  /defines.php ;
}

if (!defined( _JDEFINES )) {
    define( JPATH_BASE , dirname(__FILE__));
    require_once JPATH_BASE. /includes/defines.php ;
}

require_once JPATH_BASE. /includes/framework.php ;
require_once JPATH_BASE. /includes/helper.php ;
require_once JPATH_BASE. /includes/toolbar.php ;

JDEBUG ? $_PROFILER->mark( afterLoad ) : null;

$app = JFactory::getApplication( administrator );

$app->initialise(array(
     language  => $app->getUserState( application.lang )
));

JDEBUG ? $_PROFILER->mark( afterInitialise ) : null;

$app->route();

JDEBUG ? $_PROFILER->mark( afterRoute ) : null;

$app->dispatch();

JDEBUG ? $_PROFILER->mark( afterDispatch ) : null;

$app->render();

JDEBUG ? $_PROFILER->mark( afterRender ) : null;

echo $app;
?>

[EDIT] Note: I should mention that I m familiar with the OO concept. I m a .Net developer for several years now. I just want a (if possible) quick way to know what should be done if this approach is chosen in the web world.

最佳回答
问题回答

Joomla是全委会的,可能不是最好的学习场所。

如果你想要知道PHP OO,那么在http://php.net/manual/en/English.oop5.php上,“rel=“nofollow”的“官方指南

I also suggest to have a look to PHP5 framework instead of CMS they are cleaner in many case. Especially have a look to 5.3 framework where you can see some new features like namespace. Some frameworks 5.3 are:

Lithium

rel=“nofollow”>Nanoframework

rel=“nofollow”>symfony2

希望这一帮助





相关问题
Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

JSON with classes?

Is there a standardized way to store classes in JSON, and then converting them back into classes again from a string? For example, I might have an array of objects of type Questions. I d like to ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Passing another class amongst instances

I was wondering what is the best practice re. passing (another class) amongst two instances of the same class (lets call this Primary ). So, essentially in the constructor for the first, i can ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...

热门标签