DooPHP IRC channel


Simple Template example failing

Discussion about installation and environment issues.

Simple Template example failing

Postby richard24 » Sat Jan 09, 2010 11:00 pm

Having a few problems getting data passed to a view....What am I missing here?

The Controller

Code: Select all
 public function test(){
     
             $data['title'] = 'Hi This is Title!';
        $data['content'] = 'Some content here...';
       
        //Both syntax can be used:
        $this->view()->render('rich', $data);

       // $this->render('rich', $data);



    }


The View rich.html
Code: Select all
<html>
<head>
    <title>{{title}}<title>
</head>

<body>
    <p>hello {{content}}</p>
</body>
</html>
richard24
 
Posts: 3
Joined: Sat Jan 09, 2010 10:52 pm

Re: Simple Template example failing

Postby richard24 » Sun Jan 10, 2010 12:56 am

Closed - Permissions problem... :roll:
richard24
 
Posts: 3
Joined: Sat Jan 09, 2010 10:52 pm

Re: Simple Template example failing

Postby wrlee » Mon Jul 05, 2010 8:41 pm

For the rest of us, what should the file permissions be?

Bill...
wrlee
 
Posts: 52
Joined: Sun Jul 04, 2010 7:48 pm

Re: Simple Template example failing

Postby RichardM » Mon Jul 05, 2010 10:05 pm

Apache user needs write access to at least the protected/viewc/ folder...if using cacheing and other features which need to write files to the system the write permissions are also needed on these folders too. Btw you should be able to either:
1) Turn on DooPHP's diagnostic feature...just need to include it and this should report what paths it can't write to
2) Turn on display errors and set the reporting level to have PHP report its problems on screen...posted code for a this a couple of times over last few days
3) Ensure error logging to a file is turned on and take a look.

All 3 methods will let you know where it can not write files to...provide the parent folders (should be fairly obvious what these are) with the required permissions to write within these folders.


Richard
Note: code samples my not be 100% accurate.
RichardM
 
Posts: 1329
Joined: Sun Aug 30, 2009 6:03 pm
Location: Cumbria, UK

Re: Simple Template example failing

Postby wrlee » Thu Jul 15, 2010 8:47 pm

My problems were entirely due to my specifying http://domain.com/... rather than http://www.domain.com/... for the "App URL"

Would it be possible for the SWF code to follow redirects so that this would not be a problem? It would have been nice if "App URL" had been prepopulated with the URL based on how it was invoked.

And it would also be nice if the "URL" field were more descriptive--it is only the part of the URI path that is relative to the domain/sub-folder.

I guess I should put these in the "Feature Requests" area.
wrlee
 
Posts: 52
Joined: Sun Jul 04, 2010 7:48 pm

Re: Simple Template example failing

Postby RichardM » Thu Jul 15, 2010 11:54 pm

I'm sure the default code copes with this...I have not changed my APP_URL definition on any of my sites and they work fine with both www.domain.com and domain.com and domain.com/some/sub/folder/ etc...the issue here seems more like you redefined the default code...it works out of the box...assuming you do not start touching things...if you start changing the code for base_path, subfolder etc...you should first work out how they are getting set...and then look at changing the settings...okay the guides need writing but it DOES work out of the box if you do not go rearranging things.


Richard
Note: code samples my not be 100% accurate.
RichardM
 
Posts: 1329
Joined: Sun Aug 30, 2009 6:03 pm
Location: Cumbria, UK


Return to Installation & Setup

Who is online

Users browsing this forum: No registered users and 2 guests

cron