如何在Croogo中安装和使用CakePHP插件?

时间:2015-07-09 14:32:29

标签: cakephp croogo

我想在Croogo 2中使用一些CakePHP插件,例如CakeGrid。 我该怎么办?

干杯

1 个答案:

答案 0 :(得分:1)

尝试:
打开文件Config / bootstrap.php并添加代码文件结尾

DELIMITER $$
CREATE PROCEDURE `procedure_one`(IN `name_to_find` VARCHAR(45), IN `varchar_for_table2` VARCHAR(45))
BEGIN
    SET @foundId = `function_two`(`name_to_find`);
    CALL `procedure_three`(`varchar_for_table2`, @foundId);
END$$

CREATE FUNCTION `function_two`(`name_to_find` VARCHAR(45))
RETURNS INT(11)
BEGIN
    DECLARE varResult INT(11);
    DECLARE myCursor CURSOR FOR(
        SELECT
            `t1`.`id`
        FROM table1 AS `t1`
        WHERE `t1`.`name` = `name_to_find`
        LIMIT 1);
    OPEN myCursor;
    FETCH myCursor INTO varResult;
    RETURN varResult;
END$$

CREATE PROCEDURE `procedure_three`(IN `varchar_for_table2` VARCHAR(45), IN `id_from_table1` INT(11))
BEGIN
    INSERT INTO `table2`(`vc_for_t2`, `id_from_t1`) 
        VALUES(`varchar_for_table2`, `id_from_table1`);
END$$

然后根据instruction in croogo controller and view file添加更改。