We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Working example of create_channel anyone?

Development and Programming

Environ-IT's avatar
Environ-IT
26 posts
15 years ago
Environ-IT's avatar Environ-IT

Can anyone provide an example of how to create a channel. I’ve tried basing my code on the example in the docs, but it just tells me an error has occured. If I could see the error it might help, but am too much of a newbie to know how to display it!

$this->EE->load->library('api');
$this->EE->api->instantiate('channel_structure');

        
        $data = array( 'channel_title' => 'test', 'channel_name' => 'test'); 
        if ($this->EE->api_channel_structure->create_channel($data) === FALSE) { show_error('An Error Occurred Creating the Channel <pre>' . '</pre>

<p>'); }
</pre>

I’ve stripped the call down to the bare minimum to try and find out what I’m doing wrong, but to no avail.

Any clues would be most welcome!

Andrew

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.