دوستان من قصد داشتم ک مثلا بعضی تابع ها در Controller ک فراخونی میکنم و استفاده میکنم تو url برای کاربر نیاره و نشونش نده
میشه این کار؟
Printable View
دوستان من قصد داشتم ک مثلا بعضی تابع ها در Controller ک فراخونی میکنم و استفاده میکنم تو url برای کاربر نیاره و نشونش نده
میشه این کار؟
نوع تابع رو از Public تغییر بده به private یا protected
اینجوری دیگه خارج از کلاس قابل فراخانی نیستن
میتونید اجرای یک کنترلر یا تابعی از کنترلر رو منوط به احراز هویت کاربری با یک سطح دسترسی خاص کنید. برای مثال خودتون رو ادمین قرار بدید و اجرای اون تابع فقط در صورتی که ادمین وارد شده بود صورت بگیره.
البته سوالتون برای من زیاد واضح نبود.
منظورتون اینه که مثلا Url زیر
http://example.com/controller/method/2
تبدیل بشه به
http://example.com/Post
؟
برای این منظور وارد فایل Route.php در فولدر Config بشین
و لاین زیر رو اضافه کنید
route['controller/method/2']="Post"
http://www.webolar.com