Jump to content

Tools :: fd ('text', 'log') in 1.7


rafapas22

Recommended Posts

Goodnight. I have a question with PS1.7, I use Tools :: fd ('text', 'log') to be able to debug my modules but with 1.7 I can not, it does not work. What alternative do I have to debug php files and see logs in the Chrome console in PS 1.7? Thanks in advance

Link to comment
Share on other sites

Below is the code from PS v1.6. You can do with that whatever you like.

    /**
    * Display a var dump in firebug console
    *
    * @param object $object Object to display
    */
    public static function fd($object, $type = 'log')
    {
        $types = array('log', 'debug', 'info', 'warn', 'error', 'assert');

        if (!in_array($type, $types)) {
            $type = 'log';
        }

        echo '
			<script type="text/javascript">
				console.'.$type.'('.Tools::jsonEncode($object).');
			</script>
		';
    }

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...