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

view parser throws InvalidArgumentException #704

Closed
gustavojm opened this issue Sep 4, 2017 · 6 comments
Closed

view parser throws InvalidArgumentException #704

gustavojm opened this issue Sep 4, 2017 · 6 comments

Comments

@gustavojm
Copy link
Contributor

gustavojm commented Sep 4, 2017

$this->parser = \Config\Services::parser();

render() method called automatically with $file = /var/www/codeigniter4/application/Views/_database.tpl.php

throws InvalidArgumentException on line 147 of Parser.php

@lonnieezell
Copy link
Member

I'll need to see a little more code, because it you do what you've shown:

$parser = Services::parser();
$parser->render();

you get an error because render requires a string value in the first parameter.

@gustavojm
Copy link
Contributor Author

Thanks for your prompt reply. I don't even call the render() method. It gets called by CI I think

the source code of the method in the controller is the following:

public function parsear() {
        $db = \Config\Database::connect();
        $this->parser = \Config\Services::parser();
        $table_name = 'users';
        $fields = $db->getFieldNames($table_name);
        print_r($fields);
}

the attached file is the "view-source" of the page because the backtrace does not get rendered.

view-source_ci4.com_index.php_categories_parsear.txt

@lonnieezell
Copy link
Member

CI doesn't automatically call the render method, so that would be in your code somewhere. Maybe a parent controller?

@gustavojm
Copy link
Contributor Author

Seems to be called by
BASEPATH/Debug/Toolbar/Collectors/Database.php : 186

		$output = $parser->setData($data)
				->render('_database.tpl');

@jaynarayan89
Copy link
Contributor

jaynarayan89 commented Sep 6, 2017

I have similar problem. I have posted details on forum

@lonnieezell
Copy link
Member

@gustavojm Doh! Silly me. Forgot the toolbar used the Parser. Looking into it.

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

3 participants