php - Code Igniter Custom Helper -
I am new to Code Igniter / OOP but am trying to find out.
I am trying to make an assistant that I can use in my code; (Function_exists ('email')) {function email ($ type, $ to $ theme, $ object) {switch ($ type)} {/} case 'new': $ body = "hello" $ item [first name ']' '. $ Item ['last name'] ",". " & gt; Thank you."; break; } // Send it $ $ -> Load-> Library ('email'); $ This- & gt; Email-> For (for $); $ This- & gt; Email-> From ('blah@website.com ',' James'); $ This- & gt; Email-> Subject ($ theme); $ This- & gt; Email-> Message ($ body); $ This- & gt; Email-> Send (); }}
Then I include it in the autoload for the Helper section.
When I try to access it within my controller, I get an error. Here's the error that I'm getting: This means that you use the $ this keyword outside an object Can not say @ crayton. Accessories are usually used only to embed in HTML, such as formatting data. What you have to do is read a bit about how to make it. $ obect ['first name'] = 'Carl'; $ Obect ['Last Name'] = 'Blow'; Email ('new', 'test@website.com', 'test', $ object);
Fatal error: When using $ in the object in C: not in reference: \ inetpub \ wwwroot \ Strong> $ this when the item is not in context
& lt; P & gt; & Lt ;? Php echo formatHelper (escape ($ in)); ? & Gt; & Lt; / P & gt;
Comments
Post a Comment