Trying to create a simple characters page and it's...
# box-products
o
Trying to create a simple characters page and it's giving me:
Copy code
variable [CHARACTER_COUNT] doesn't exist
I am passing in the variable into the view: Handler:
Copy code
component extends="coldbox.system.EventHandler" secured {

	// Default Action
	function index( event, rc, prc ){
		prc.pageTitle = "Characters";

        var character_count = getInstance("character")
            .where("userid", auth().user().getID() ?: -1 )
            .count();

        if (character_count > 0 ) {

        var characters = getInstance("character")
            .where("id", auth().user().getID() ?: -1 );
        }

		event.setView( "characters/index", { character_count: character_count } );
	}

}
View:
Copy code
<cfoutput>
		<h1>Characters</h1>
		<cfif character_count EQ 0>
			<p>No Characters, why not create one?</p>
		</cfif>
</cfoutput>
Any ideas?
c
Arguments passed to the view are available in the
args
struct, so you want to use
args.character_count
in the view