mic
mic

Reputation: 23

How to write correct application.php configuration for MasterClass within Prado 3.3.0?

I can't find a correct way to write a correct php array for the service definition of a MasterClass within PRADO application.php configuration file.

I'v got a working application on a server who has no problems reading the application.xml. The definition looks like this:

 <services>
    <service id="page" class="TPageService" DefaultPage="Home">
      <pages MasterClass="Application.layouts.Forms" />
    </service>
 </services>

My application.php version looks like this but I got something wrong:

'services' => array(
     'page' => array(
        'class' => 'TPageService',
        'properties' => array(
            'DefaultPage' => 'Home'
        ),
        'page' => array(
            array('MasterClass' => 'Application.layouts.Forms')
        )
    ),
  )

Does anybody know how to set it up correctly? I looked through the example applications on github but couldn't find a solution.

Upvotes: 0

Views: 36

Answers (1)

Natsimhan
Natsimhan

Reputation: 1

The correct name (key) is "pages" and not "page", and "MasterClass" is a property of "pages" (as visible on the xml version).

So it should be defined as such:

  'services' => array(
    'page' => array(
      'class'      => 'TPageService',
      'properties' => array(
        'DefaultPage' => 'Home'
      ),
      'page'       => array(
        'properties' => array(
          'MasterClass' => 'Application.layouts.Forms'
        )
      )
    )
  )

Upvotes: 0

Related Questions