Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My params are vanishing #93

Open
tsbits opened this issue Oct 6, 2014 · 1 comment
Open

My params are vanishing #93

tsbits opened this issue Oct 6, 2014 · 1 comment

Comments

@tsbits
Copy link

tsbits commented Oct 6, 2014

Hello.

I try to render a template with some params.
Those params contains the result of a sql statement.
That sql statement is working, i know that because I have an api that use the same and that work perfectly.

Here is what I do :

public static function editproject(){
    $template = new EpiTemplate();
    $params = array();
    $params['pageTitle'] = 'Edit Project';
    $project = getDatabase()->one('SELECT * FROM projects WHERE id = '.$_GET['id']);
    $params['project'] = $project;

    $template->display('edit-project.php', $params);
}

If I do a var_dump of $params or just $pageTitle on my template it return me 'NULL'.

Am I doing something wrong ?
Thanks.

@jmathai
Copy link
Owner

jmathai commented Oct 6, 2014

Can you paste in the part of edit-project.php where you're calling var_dump? Your code looks correct and var_dump($pageTitle) should not output NULL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants