dongzi1397 2015-10-14 11:29
浏览 37

在phpprobid中创建控制器错误

Created controller and tried to access it by url got an error like 404 Error

The page you are looking for could not be found.

Try checking the URL for errors, then hit the refresh button on your browser.

Used the fallowing procedure

 //created route

 'app-test-index'         => array(
        'test',
        array(
            'controller' => 'test',
            'action'     => 'index',
        ),
    ),

//controller

 namespace App\Controller;

  use Ppb\Controller\Action\AbstractAction,
 Cube\Controller\Front,
 Cube\View,
 Cube\Validate\Url as UrlValidator,
 Cube\Controller\Request,
 Ppb\Service;


class Test extends AbstractAction
{
public function Index()
{
    die('ok');
}
public function test()
{
    die('ok');
}
}

How to create model view controller in PHPProbid

how to customize PHPProbid

Thanks

  • 写回答

1条回答 默认 最新

  • doy2255 2016-10-25 09:02
    关注

    How to create a controller in PHPPROBID version 7.8

    Step 1: Create a controller file in corresponding module

    step 2: Edit the model Acl file in corresponding module

    for example

    a) Create a controller Test.php in module/App/src/App/Controller.

    b) Add resources (Give permissions to user roles for the created controller) in

    module/App/src/App/Model/Acl.php file

    In our case you need to add the following lines

    $test = new Permissions\Resource('Test');
    $this->addResource($test);
    $this->allow('Guest', 'Test');
    

    It is important to note that the module/App/src/App/Model/Acl.php file will be replaced during phpprobid update so you need to create a folder named mods in root(IF already exist no need to create). Copy the file to mods folder with corresponding folder structure In our example copy Acl.php to mods/module/App/src/App/Model folder.

    Now you can access your controller

    http://your_domain.com/index.php?module=app&controller=test&action=index

    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥20 求用stm32f103c6t6在lcd1206上显示Door is open和password:
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法