INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

php loading modules query

php loading modules query

(OP)
I'm learning php and the question is probably simple to many of you, what is the loading procedure of this url?

http://www.mysite.co.uk/index.php?module=members&a...

there are many folders named like the above, I'm assuming its MODULE first or is the root index.php file ran first?

Thanks for patience

RE: php loading modules query

Not entirely sure what you are asking.

In a url like that, index.php is the only thing that can be said to run.

What you can determine from that URL is that index.php runs and receives 3 parameters which it may or may not do things with.

There is no folder there, and now way to know what it is doing with those parameters. It could be completely ignoring them. But since we don't know what the code of index.php does there's no way to know what those parameters mean if anything.

Its the equivalent of:

index.php?flavor=vanilla&syrup=chocolate&cherries=yes, you could assume its making an icecream but it could very well me making a pancake. no way to know what the end product will be just based on the parameters.

Its just getting values in variables passed to it, and the code decides what to do with them.

If its then calling in extra files, or additional code based on those parameters that is independent, and cannot really be determined by the URL.


----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: php loading modules query

Looks to be a CMS url that is showing a 'browse list' of members ordered by an attribute of 'members' called 'reputation'.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: php loading modules query

(OP)
Ive attached a picture of folders, for instance the above url, the file called is browse.phtml in the reputation folder is called, if I make changes to it, its reflected in the browser. I am trying to add my own file but it says file not found, ive done exactly same as browse.phtml but still says file not found

RE: php loading modules query

(OP)
Ive copied the exact link construction as above but changed controller to ebay because that is the folder and the action to importebay and filter is a command within the file to open

CODE

<li><a href="<?php echo $this->url(array('module' => 'members', 'controller' => 'ebay', 'action' => 'importebay', 'filter' => 'open')); ?>"
		  title="<?php echo $this->_('Import From Ebay'); ?>"><?php echo $this->_('Import From Ebay'); ?></a>	</li> 

importebay.phtml file

CODE

switch ($filter) {
            case 'open':
                $filterLabel = $this->_('Selling Open Filter');
                break;
            case 'closed':
                $filterLabel = $this->_('Selling Closed Filter');
                break;
            default:
                $filterLabel = null;
                break;
                 ..............etc 


Just get and its exactly the same just another folder but same file, do I have to list it somewhere has available?

404 Error

The page you are looking for could not be found.

Try checking the URL for errors, then hit the refresh button on your browser.

RE: php loading modules query

There is probably some code in an "index.php" in one of the folders that redirects or provides a 'context' based on the URL parameters for the data to be retrieved.

Knowing what CMS it is may be more useful than a naked folder list, as we have absolutely no idea what code is in the folders.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: php loading modules query

(OP)
Sorry Chris its all PHP with extensions .phtml and this is the only thing in index.php im abit suspicious about the cube application?

CODE

ini_set('display_errors', 1);
error_reporting(E_ALL);

define('APPLICATION_PATH', realpath(__DIR__));

set_include_path(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'library');

require_once 'Cube/Application.php';

$application = Cube\Application::init(include 'config/global.config.php');
$application->bootstrap()
        ->run(); 

RE: php loading modules query

(OP)
This is a nightmare, seems everything runs on modules and controllers and links are ran from xml file

CODE

<address_book>
                                <label>Address Book</label>
                                <module>members</module>
                                <controller>account</controller>
                                <action>address-book</action>
                            </address_book> 

How would i implement my new file around this?

RE: php loading modules query

As I said, and Chris explained as well,

How you would add a new module or controller or index depends on what the PHP code is doing with the variables passed to it. The part with module=...&controller=...&action=...

Is just passing variables to index.php to use and access the code.

You need to mimic that layout somehow to add more code to it. Its also possible it uses some type of master list of modules and its controllers and actions to get the proper paths to whatever it retrieves based on those variables.

Quote:


Just get and its exactly the same just another folder but same file, do I have to list it somewhere has available?

We absolutely cannot tell you how to that. We have no idea how its working, or what its doing to determine how to load modules controllers and actions based on the variables.

You have access to the core PHP code, you can tell us what its doing in index.php with the module, controller an action variables.


Just for arguments sake, and assuming a straight forward layout for this. is there a file called "browse.phtml" inside the reputation folder that is inside the members folder?

----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: php loading modules query

(OP)
Sorry for delay, yes there is a browse.phtml in reputation, if you look at this ML file called navigation, it also shows the links

CODE

<label>Feedback</label>
                        <module>members</module>
                        <controller>reputation</controller>
                        <action>browse</action>
                        <resource>Reputation</resource> 

RE: php loading modules query

(OP)
I'm not sure what resource is

RE: php loading modules query

(OP)
Is there a project application to step threw to find out where it is going? I use to use one for c++

RE: php loading modules query

Quote:

Is there a project application to step threw to find out where it is going?

That's kind of what we have been asking for.


It's just XML and somewhere in the code for the site will be a parser for the XML that is coded in PHP.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: php loading modules query

I don't think you'll find an app that will tell you what some PHP code is doing or where variables are being used.

Stepping through the code is generally a manual process in PHP. Follow the code, and to see what its doing exactly.

Now that we know there's a browse.html there, we can at least test to see if it is straight forward usage, or if it s doing something more.


If you save a file in the reputation folder called test.phtml that includes some very basic code:

CODE

<?php
echo "<h1>This is a test</h1>";
?> 

If you call: http://www.mysite.co.uk/index.php?module=members&a...=test

Does that do anything?



----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: php loading modules query

(OP)
using this link and uploading test.phtml

CODE

http://www.mysite.co.uk/index.php?module=members&controller=reputation&action=test 

I get

404 Error

The page you are looking for could not be found.

Try checking the URL for errors, then hit the refresh button on your browser.

I may as well show you the site because its still in its infancy, I have turned off SEO's

http://www.badbidder.co.uk/index.php?module=member...

RE: php loading modules query

No errors here, all I get is the home page for bad bidders. If the link is producing an error, that means the code is doing more than just reading the parameters from the URL, and you will need to find out what that is.

Since we cannot see the code, there's no way for us to know what it is doing.

I would suggest you hire someone that knows PHP and can go through the code and understand what it is doing.

----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: php loading modules query

(OP)
Ok i will, could i ask, what is this doing?

CODE

$application = Cube\Application::init(include 'config/global.config.php');
$application->bootstrap()
        ->run(); 

RE: php loading modules query

"$application = Cube\Application::init(include 'config/global.config.php');"
is; Instantiate object $application and 'include' constants and variables from a configuration file.


"$application->bootstrap() ->run(); "
is 'call' method bootstrap in object application and 'call' method run in application

The -> is generally called an "arrow" (or single arrow) and is used in Object Oriented Programming (OOP) to refer to a method or property of an object.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: php loading modules query

It is statically calling the function or method init() from the class definition "Application" that exists in the "Cube" namespace, and passing to it an include command with a filename so it adds extra code and probably variable definitions from the specified file.

It then assigns the result of the init() function to the variable $application. That result is apparently an object.


It is not really instantiating anything we can see.

It then accesses the object assigned to $application to run and access its methods and properties.

It calls the method run() from the object generated by calling the bootstrap() method that is part of the object that was assigned to the $application variable.

Other than that, its hard to say what those methods actually do inside themselves.

----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: php loading modules query

(OP)
Thanks, i get that that, its member functions, would there be a library somewhere holding the files necessary for the site like "vacunita" explains?

just adding a another file ie: test.phtml gives an error so there must be other areas that need test.phtml adding

RE: php loading modules query

Yes, very likely in the App folder or config folder. the XML file may also need to have an entry added to it so it can find all the appropriate pieces.



----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: php loading modules query

(OP)
Yes i sussed the xml out and I copied the selling section then renamed the tab, but soon as a added a new file name (like ie: test.phtml) file not found, i will have a look in app folder and config

RE: php loading modules query

(OP)
Ok why this section on tek-tips isn't busy thought I would ask the question, what is bootstrap doing in this function?

CODE

public function bootstrap()
    {
        if (!empty($this->_options['modules'])) {
            $this->_moduleManager = ModuleManager::getInstance()
                    ->setModules($this->_options['modules']);

            $this->setOptions(
                    $this->_moduleManager->getConfig(
                            $this->_moduleManager->getActiveModule()));

            $this->_autoloader->addPaths(
                    $this->_moduleManager->getPaths());
        }
        else {
            throw new \InvalidArgumentException('At least one module needs to be created in order for the application to function.');
        }

        $this->getBootstrap()->bootstrap();

        return $this;
    } 

I'm pretty rusty coming back to programming, finished in 2005 but I never know such an enigma trying to follow this code

If I remember is the variable $this used within the object? I get this message after declaring some libraries

Fatal error: Using $this when not in object context - $stmt = $this->_adapter->query($query);

At some point the front page items should be called calling index.php but I'm trying to find where, this is the full code page of cube/application.php

CODE

namespace Cube;

use Cube\Loader\Autoloader;

class Application
{
    /**
     *
     * the name of the module bootstrap files
     */

    const BOOTSTRAP = 'Bootstrap';

    /**
     *
     * holds the configuration options array
     * 
     * @var array
     */
    protected $_options;

    /**
     * autoloader object
     *
     * @var \Cube\Loader\Autoloader
     */
    protected $_autoloader;

    /**
     *
     * requested module name
     * 
     * @var \Cube\ModuleManager
     */
    protected $_moduleManager;

    /**
     * 
     * bootstrap
     *
     * @var \Cube\Application\Bootstrap
     */
    protected $_bootstrap;

    /**
     * 
     * returns an instance of the object and creates it if it wasnt instantiated yet
     * 
     * @return \Cube\Application
     */
    private static $_instance;

    /**
     * 
     * class constructor
     * 
     * initialize autoloader
     * 
     * @param array $options     configuration array
     */
    protected function __construct($options = array())
    {
        require_once 'Debug.php';
        Debug::setTimeStart();
        Debug::setMemoryStart();
        Debug::setCpuUsageStart();

        require_once 'Loader/Autoloader.php';

        $this->_autoloader = Autoloader::getInstance()
                ->register();

        $this->setOptions($options);
    }

    /**
     * 
     * initialize application as singleton
     * 
     * @param array $options     configuration array
     * @return \Cube\Application
     */
    public static function init($options = array())
    {
        if (!self::$_instance instanceof self) {
            self::$_instance = new self($options);
        }

        return self::$_instance;
    }

    /**
     * 
     * returns an instance of the application object
     * 
     * @return \Cube\Application
     */
    public static function getInstance()
    {
        return self::$_instance;
    }

    /**
     * 
     * get options array
     * 
     * @return array
     */
    public function getOptions()
    {
        return $this->_options;
    }

    /**
     * 
     * set options array
     * 
     * @param array $options
     * @return \Cube\Application
     */
    public function setOptions(array $options)
    {
        if (!empty($this->_options)) {
            $this->_options = array_replace_recursive(
                array_merge_recursive($this->_options, $options), $options);
        }
        else {
            $this->_options = $options;
        }

        return $this;
    }

    /**
     * 
     * get a key from the options array 
     * 
     * @param string $key
     * @return mixed|null
     */
    public function getOption($key)
    {
        if (isset($this->_options[$key])) {
            return $this->_options[$key];
        }

        return null;
    }

    /**
     * 
     * set or unset a key in the options array
     * 
     * @param string $key
     * @param mixed|null $value
     * @return \Cube\Application
     */
    public function setOption($key, $value = null)
    {

        $this->_options[$key] = $value;

        return $this;
    }

    /**
     * get bootstrap object
     * we will first search for the requested module bootstrap and only if the file doesnt exist will we call the default bootstrap class from the library
     * the bootstrap class will only be created once
     *
     * @return \Cube\Application\Bootstrap
     */
    public function getBootstrap()
    {
        if (!($this->_bootstrap instanceof Application\Bootstrap)) {
            $bootstrap = $this->_moduleManager->getActiveModule() . '\\' . self::BOOTSTRAP;

            if (class_exists($bootstrap)) {
                $this->_bootstrap = new $bootstrap($this);
            }

            if ($this->_bootstrap === null) {
                $this->_bootstrap = new Application\Bootstrap($this);
            }
        }

        return $this->_bootstrap;
    }

    /**
     * initialize module manager and bootstrap application
     *
     * @throws \InvalidArgumentException
     * @return \Cube\Application
     */
    public function bootstrap()
    {
        if (!empty($this->_options['modules'])) {
            $this->_moduleManager = ModuleManager::getInstance()
                    ->setModules($this->_options['modules']);

            $this->setOptions(
                    $this->_moduleManager->getConfig(
                            $this->_moduleManager->getActiveModule()));

            $this->_autoloader->addPaths(
                    $this->_moduleManager->getPaths());
        }
        else {
            throw new \InvalidArgumentException('At least one module needs to be created in order for the application to function.');
        }

        $this->getBootstrap()->bootstrap();

        return $this;
    }

    /**
     * Run the application
     *
     * @return void
     */
    public function run()
    {
        
        $this->getBootstrap()->run();
    }

} 

RE: php loading modules query

It's not "BootStrap" as in the javascript/CSS/HTML 'framework' usage, it is the 'bootstrapping' usage of being;

"Trying to pull yourself up by your boot straps (laces)" which is why 'booting' a computer is termed as such.

In your case "bootstrap()" is likely to be a method, the OOP term for a function, that 'kicks/boots' the application into an initial state then run() is the method that starts the main process(es)

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: php loading modules query

(OP)
I see, its very hard to follow, i have my own import code, all i need is the connection to db and execute methods but its ny on impossible to find. Even in the view folders wrapped in html with extension .phtml is the use of $this-> outside its class, there are no includes in any file so i'm baffled how this bloody project works, should i resort in pulling in my own PDo calls? that too me is reinventing the wheel if i already have it hidden somewhere, any particular searches i could use to find a connection?

RE: php loading modules query

(OP)
After this call... where does this go? and if someone clicked a link that didnt run index.php how would it run bootstrap?

CODE

ini_set('display_errors', 1);
error_reporting(E_ALL);

define('APPLICATION_PATH', realpath(__DIR__));

set_include_path(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'library');

require_once 'Cube/Application.php';

$application = Cube\Application::init(include 'config/global.config.php');
$application->bootstrap()
        ->run(); 

RE: php loading modules query

Quote (aa__live)

where does this go?
That depends entirely on what run() tells it to do.

Quote (aa__live)

if someone clicked a link that didnt run index.php

index.php will ALWAYS run if the folder URI is requested, that's the reason for having a 'default document' for a folder so site.tld/folder/index.php does not have to be explicitly specified.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: php loading modules query

(OP)
Looking at the above code i pasted "class Application" can you tell me off that?

RE: php loading modules query

Quote (aa__live)

Looking at the above code i pasted "class Application" can you tell me off that?

Could you be a little less vague as to what you are asking????

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: php loading modules query

(OP)
Sorry, this code, index runs the code below, where does it go from here, tiny lesson would be helpful, ive seen some php but this project is very difficult to follow

CODE

namespace Cube;

use Cube\Loader\Autoloader;

class Application
{
    /**
     *
     * the name of the module bootstrap files
     */

    const BOOTSTRAP = 'Bootstrap';

    /**
     *
     * holds the configuration options array
     * 
     * @var array
     */
    protected $_options;

    /**
     * autoloader object
     *
     * @var \Cube\Loader\Autoloader
     */
    protected $_autoloader;

    /**
     *
     * requested module name
     * 
     * @var \Cube\ModuleManager
     */
    protected $_moduleManager;

    /**
     * 
     * bootstrap
     *
     * @var \Cube\Application\Bootstrap
     */
    protected $_bootstrap;

    /**
     * 
     * returns an instance of the object and creates it if it wasnt instantiated yet
     * 
     * @return \Cube\Application
     */
    private static $_instance;

    /**
     * 
     * class constructor
     * 
     * initialize autoloader
     * 
     * @param array $options     configuration array
     */
    protected function __construct($options = array())
    {
        require_once 'Debug.php';
        Debug::setTimeStart();
        Debug::setMemoryStart();
        Debug::setCpuUsageStart();

        require_once 'Loader/Autoloader.php';

        $this->_autoloader = Autoloader::getInstance()
                ->register();

        $this->setOptions($options);
    }

    /**
     * 
     * initialize application as singleton
     * 
     * @param array $options     configuration array
     * @return \Cube\Application
     */
    public static function init($options = array())
    {
        if (!self::$_instance instanceof self) {
            self::$_instance = new self($options);
        }

        return self::$_instance;
    }

    /**
     * 
     * returns an instance of the application object
     * 
     * @return \Cube\Application
     */
    public static function getInstance()
    {
        return self::$_instance;
    }

    /**
     * 
     * get options array
     * 
     * @return array
     */
    public function getOptions()
    {
        return $this->_options;
    }

    /**
     * 
     * set options array
     * 
     * @param array $options
     * @return \Cube\Application
     */
    public function setOptions(array $options)
    {
        if (!empty($this->_options)) {
            $this->_options = array_replace_recursive(
                array_merge_recursive($this->_options, $options), $options);
        }
        else {
            $this->_options = $options;
        }

        return $this;
    }

    /**
     * 
     * get a key from the options array 
     * 
     * @param string $key
     * @return mixed|null
     */
    public function getOption($key)
    {
        if (isset($this->_options[$key])) {
            return $this->_options[$key];
        }

        return null;
    }

    /**
     * 
     * set or unset a key in the options array
     * 
     * @param string $key
     * @param mixed|null $value
     * @return \Cube\Application
     */
    public function setOption($key, $value = null)
    {

        $this->_options[$key] = $value;

        return $this;
    }

    /**
     * get bootstrap object
     * we will first search for the requested module bootstrap and only if the file doesnt exist will we call the default bootstrap class from the library
     * the bootstrap class will only be created once
     *
     * @return \Cube\Application\Bootstrap
     */
    public function getBootstrap()
    {
        if (!($this->_bootstrap instanceof Application\Bootstrap)) {
            $bootstrap = $this->_moduleManager->getActiveModule() . '\\' . self::BOOTSTRAP;

            if (class_exists($bootstrap)) {
                $this->_bootstrap = new $bootstrap($this);
            }

            if ($this->_bootstrap === null) {
                $this->_bootstrap = new Application\Bootstrap($this);
            }
        }

        return $this->_bootstrap;
    }

    /**
     * initialize module manager and bootstrap application
     *
     * @throws \InvalidArgumentException
     * @return \Cube\Application
     */
    public function bootstrap()
    {
        if (!empty($this->_options['modules'])) {
            $this->_moduleManager = ModuleManager::getInstance()
                    ->setModules($this->_options['modules']);

            $this->setOptions(
                    $this->_moduleManager->getConfig(
                            $this->_moduleManager->getActiveModule()));

            $this->_autoloader->addPaths(
                    $this->_moduleManager->getPaths());
        }
        else {
            throw new \InvalidArgumentException('At least one module needs to be created in order for the application to function.');
        }

        $this->getBootstrap()->bootstrap();

        return $this;
    }

    /**
     * Run the application
     *
     * @return void
     */
    public function run()
    {
        
        $this->getBootstrap()->run();
    }

} 

RE: php loading modules query

(OP)
could i ask, "this" is used everywhere, is "this"

CODE

$this->getBootstrap()->run(); 

equivalent too

CODE

$Application->getBootstrap()->run(); 

in the above code?

RE: php loading modules query

(OP)
My problem is I have theme files extension .phtml using code within the file and no include classes at the top of the page and the use of the word $this in the file so I have no reference has to what object it is?

Fatal error: Using $this when not in object context

CODE

if ($this->userDetails($this->loggedInUser['id'])->getUser()->isVerified() === false) { 
	echo $this->partial('partials/user-verification-message.phtml', null); 
} 

the file has no declaration to the object above this

RE: php loading modules query

Quote (aa__live)

so I have no reference has to what object it is?

Correct.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: php loading modules query

(OP)
In this circumstance, is "view" a class somewhere?

CODE

$view->loggedInUser = $this->_user; 

RE: php loading modules query

Its an object. It may or may not be an object instantiated from a defined class however.

The line is simply setting the loggedInUser Property of the $view object to whatever the current object's _user property is set to.






----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: php loading modules query

(OP)
I thought so, trouble is, I cannot find "loggedInUser" anywhere declared other than like the above, its not a function, it looks like part of an array, how could I search for it to see how its contructed

RE: php loading modules query

Probably because its not constructed anywhere else but there where its being set to _user.

Some class somewhere is setting or constructing _user however.

You could attempt to output _user using var_dump() function to see what else may be in there.

CODE

echo var_dump($this->_user); 



----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: php loading modules query

(OP)
I will add to existing see what i can find, is there anyway of finding the class associated to "$this" at that point? "$this" is used all over this project with no real clue to what object it actually is, is that bad practice?

RE: php loading modules query

Quote:

$this" is used all over this project with no real clue to what object it actually is, is that bad practice?

No, because '$this' is ONLY a valid object reference inside the object it it is referring to. So $this may be used many, many times in the code of an application which accesses or instantiates several classes, but it only ever has scope within the 'present' object, 'past' references, or 'future' instantiations of objects MUST be referenced by name.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: php loading modules query

(OP)
How can i follow for example this *.phtml file? there is no instantiation of a class but uses '$this' so how can i know what object this is? you can understand my conversion, when i used c++ years ago, the include to an object was added at the top of the page so you had some idea where to look

CODE

<!DOCTYPE html>

<html dir="<?php echo $htmlDir = $this->htmlDir(); ?>" lang="<?php echo $this->htmlLang(); ?>">
<head>
    <?php echo $this->headTitle(); ?>

    <?php
    $this->headMeta()
        ->appendName('viewport', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no')
        ->appendHttpEquiv('X-UA-Compatible', 'IE=edge');
    echo $this->headMeta(); 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close