开发者

CodeIgniter's Scaffolding and Helper Functions Not Working

I'm following CodeIgniter's tutorial "Create a blog in 20 minutes" and I am having trouble getting the helper, anchor and Scaffolding functions to work.

I can't seem to create links on my HTML page using the helper and anchor functions.

I put

$this->load->helper('url'); $this->load->helper('form');

in the constructor under parent::Contr开发者_JAVA百科oller();

and

<p><?php echo anchor('blog/comments','Comments'); ?></p>

within the foreach loop as specified in the tutorial. But Im not getting the links to appear.

When I viewed the source as instructed in the video, this line was missing (but it was in in the video):

<form method= "post" action = "http://www.example.com/CodeIgniter/index.php/blog/comment_insert">

Secondly, I keep getting a 404 Page Not Found error whenever I try to access CodeIgniter's Scaffolding page in my browser, like so:

localhost/codeignitor/index.php/blog/scaffolding/mysecretword

I can access

localhost/codeignitor/index.php/blog

just fine. I followed CodeIgnitor's instructions in their "Create a blog in 20 minutes" by storing my database settings in the database.php file; and automatically connecting to the database by inserting "database" in the core array of the autoload.php; and I've added both

parent::Controller(); and $this->load->scaffolding('myTableName') to blog's constructor. It still gives me this 404.

Any assistance will be appreciated. Thanks in advance?


Scaffolding is deprecated, but it hasn't been removed until 2.0, and still works in 1.7.2.

You have /scaffolding/ in the URL which isn't necessary, you just use your scaffolding trigger.

I'm not sure why your helpers aren't working, your syntax looks good, unless you don't have any data in your foreach loop. the <form...> line comes from calling <?php echo form_open('form_controller_or_whatever'); ?>


localhost/codeignitor/index.php/blog/mysecretword

is just enough ....
check out this site:http://www.schobbing.de/user_guide/general/scaffolding.html you'll get a clear understanding ....

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜